mi5
asked on
Changing printer settings
Using 'form1.print' I can print the contents of a form. How do I show the user the printer dialog box so that they can select a printer and change the print options?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oh yeah
the printewr dialog just sets printer = to the printer in question
so just use printer.print
the printewr dialog just sets printer = to the printer in question
so just use printer.print
ASKER
How do I use this dialog to change the printer settings and print the contents of my form on the selected printer?
form1.PrintForm
The printer should have already been selected by the print dialog box (otherwise the cancel error would have been raised)
The printer should have already been selected by the print dialog box (otherwise the cancel error would have been raised)
The final code should look like this:
sub cmdPrintForm_Click()
on error resume next
diagsys.CancelError = true
diagsys.caption = "Print something"
diagsys.showprinter
if err = 0 then
form1.PrintForm
else
'Cancel button was pressed
endif
end sub
sub cmdPrintForm_Click()
on error resume next
diagsys.CancelError = true
diagsys.caption = "Print something"
diagsys.showprinter
if err = 0 then
form1.PrintForm
else
'Cancel button was pressed
endif
end sub
on error resume next
diagsys.CancelError = true
diagsys.caption = "Print something"
diagsys.showprinter
if err = 0 then
Printfile(diagsys.Filename
else
'Cancel button was pressed
endif