|
-
December 7th, 1999, 03:35 AM
#1
Print dialog box
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
-
December 7th, 1999, 11:49 PM
#2
Re: Print dialog box
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|