Solved

PrintDialog

Posted on 2001-08-23
3
1,247 Views
Last Modified: 2010-04-06
How can I get Printername selected in TPrintDialog after Print button pressed?
0
Comment
Question by:pmarkov
3 Comments
 
LVL 3

Accepted Solution

by:
MarcG earned 50 total points
ID: 6417152
You have to use a TPrinter

var SelectedPrinter : String;

if PrintDialog1.execute then
  SelectedPrinter := printer.printers[Printer.PrinterIndex];

TPrintDialog alone will not print
0
 

Author Comment

by:pmarkov
ID: 6417199
And I thing so, but:

Name: Star NX-1500 (in Print Dialog's drop-down box)
Type: Star NX-1500
Where: LPT1

and

if "SelectedPrinter := printer.printers[Printer.PrinterIndex]" then ===>>> SelectedPrinter = "Star NX-1500 on LPT1"  :((((

I want the NAME. Most often Name is the same as the Type (I am not sure!!!) so in this case I want NAME OR TYPE.
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6419558
PrintDialog1.Execute;
  ShowMessage(Printer.Printers[Printer.PrinterIndex]);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
System restore point 4 91
Delphi XE2 application frozen on Windows 10 10 277
How to fill array with TArray.Create? 14 79
Delphi Mdi application Child forms get behind control 7 162
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now