-
I have a datareport that I need to print without using the printer dialoge box. I do this simply by
DataReport1.PrintReport
However I need this to goto a pritner that other than the defualt. I have tried the following code.
Dim X As Printer
For Each X In Printers
If X.devicename = "hp laser" Then
Set Printer = X
Exit For
End If
Next
This does change the printer.devicename to HP Laser
However when I run datareport1.printreport it still prints to the windows default printer.
How can I change this?
Any help appreciated.
Thanks
Dan
-
I don't have the code with me here, but if I'm not mistaken, instead of changing the device name, I made the printer I wanted to print the default. Then when the form unload, I'd reset the original default printer back.