Link to home
Start Free TrialLog in
Avatar of NickLo
NickLo

asked on

Printer Paper Size from the Print Dialog.


I can set the paper size using the Printer.PaperSize = 1  (for Letter) or Printer.PaperSize = 9  (for A4 size) etc.
and the printer recognizes the different paper sizes, but how can I get the printer to read the selected paper size from the PrintDialog?  My HP Printer is set for Print.PaperSize = 1 and no matter what paper size I select on the Print Dialog the printer remains set at  Print.PaperSize = 1
ASKER CERTIFIED SOLUTION
Avatar of unknown_routine
unknown_routine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NickLo
NickLo

ASKER

Hi unknown routine.

Thanks for your help.  My question has been answered satisfactorily. You have given me an eccellent answer which has been tested and it works.

I will however appreciate a little more help, because, having used the printDlg dialog instead of a common dialog,  how can I  access the printDlg Setup Dialog?  Do I have to download and register another .dll file?  

I will accept your answer with a very good grade the next time so as not to close the question.

Again thanks a lot.
Hi,

I'm not sure if I understand this question:

how can I  access the printDlg Setup Dialog?

what is setup dialog?


this line :printDlg.ShowPrinter (Me.hWnd)

is same as

CommonDialog1.shopprinter


If this is not your question please explain more.
Avatar of NickLo

ASKER

Sorry! I have accepted the answer before posting my last comment.

The PrintSetup dialog has an OK command button instead of a Print command button.

I have actually sorted this out.  All I had to do is to enter the line :-   printDlg.Flags = cdlPDPrintSetup
before the line:  printDlg.ShowPrinter (Me.hWnd).

Before, I had a common dialog named dlgPrint.  When I tried to run the PrintSetup, an error message was generated saying something like  'Common Dialog not registered'.  I therefore assumed that another dialogue is required to be registered.  My apologies for my stupid mistake.

Again Thanks a lot 'unknown routine'
Glad to help.