Hassan's print dialog project works great. The only question that
I have on it is how can you tell if the user presses cancel. I didn't
see the cancel error in your code.
I solved my problem by using the new vb print dialog (printdlg.dll) from
Microsoft. This version will not change the windows default printer which
was my original problem. This DLL will also return an error code if the user
clicks the cancel button so that the printing sub is exited before printing
occurs.
Here is the link for the new printdlg.dll
support.microsoft.com/kb/322710/en-us
I know this is an old post but it's just what I was looking for and your project has helped me enormously, thank you. But as JamesR, I want the Cancel button to exit the Sub, and this isn't catered for. Can you help?
I know this is an old post but it's just what I was looking for and your project has helped me enormously, thank you. But as JamesR, I want the Cancel button to exit the Sub, and this isn't catered for. Can you help?
I don't know what your Problem is.
The PrintDlg-API returns 0 if there is an error processing the call or if the user clicked on cancel.
RetVal = PrintDlg(PD)
If RetVal = 0 Then Exit Sub
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad