Click to See Complete Forum and Search --> : Print dialog box


valkyrie
December 7th, 1999, 02:35 AM
Hi all,
I am using VB 5 and I am calling the print dialog box in my program. I would like to set the print range in this dialog box but am not sure how. Any suggestions???

Thanks

valkyrie
December 7th, 1999, 10:49 PM
Dear all,

Found out the solution. =)
Anyway, just want to share this with you all.
In order to set the page range, do this before calling the "ShowPrinter" method.


commondialog1.Flags = 2 'The print dialog's Page range is now set
commondialog1.FromPage = 'whatever number you like
commondialog1.ToPage = 'whatever number you like
commondialog1.Max = 'the same number you chose for the "ToPage" property. THIS is VERY IMPORTANT!
commondialog1.ShowPrinter



The "max" property of the dialog must be set in order to tell the system that you have a maximum amount of pages to print. Otherwise, you will get a runtime error of "28665:PrintDlg failed during initialization"
This would set the Page range for the Print dialog... hope that this helps.

Aahh... coding relief!!

____________________________________
The VB Bugs in my Life...