I need to get the printer name, driver name, and port name from the selected printer in the print dialog to use as parameters in a crystal report object SetPrinter method. Thanks for any help, Mike. Mike
Delphi gives you a function called Printer that returns a TPrinter object for the current printer.
Code:
if not PrintDialog1.Execute then Exit;
with Printer do begin
Look up the Printer function and the properties of the TPrinter object in help, and you'll see that they provide at least some of the info you require. For example,
Code:
Printer.Printers[Printer.PrinterIndex]
returns the name of the printer as a string. You may be able to get more via the Printer.Handle and a Windows API call.
-- Doug Burbidge mailto:dougburbidge@yahoo.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.