Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TPrinter Object

Status
Not open for further replies.

delphidestructor

Programmer
Oct 20, 2000
67
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top