If I know what printers exist in my control panel how can I specifiy one of them with VBA code prior to a report printing?? Also, how can I also specifiy the default printer?
While this is specifically designed for Adobe Writer and saving the reports as PDFs, all the code you need is there to do what you want.....
If you have questions, let me know.
=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)
Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
For those who need a bit more explanation, see below:
' This is the function of concern
Public Sub SaveReportAsPDF(strReportName As String, strPath As String)
Dim strOldDefault As String
' This string goes out and get the value for your "default" printer
strOldDefault = QueryKey("Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device"
' This string sets the default printer to a new value
SetKeyValue "Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device", "Acrobat PDFWriter", REG_SZ
' In this example, this sets the default back to what it was when this code started
SetKeyValue "Software\Microsoft\Windows NT\CurrentVersion\Windows", "Device", strOldDefault, REG_SZ
End Sub
=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)
Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.