Hi Folks
I've added a button to my switchboard that I want to use to print a report to PDF automatically. The following code takes me as far as the 'Save PDF File As' dialogue box:
Code:
Dim stDocName As String
stDocName = "MyReport"
Set Application.Printer = Application.Printers("Adobe PDF")
DoCmd.OpenReport stDocName, acNormal
Set Application.Printer = Nothing
Can anyone tell me how to accomplish the following?
- Automatically insert the file name (it will always be 'Work Overview').
- Simulate hitting 'Save'.
- Simulate answering 'Yes' when asked if I want to overwrite the existing PDF file of that name.
- Prevent the new PDF file from opening automatically.
Any suggestions would be appreciated.
Thanks
Remster
PS I'm aware of 'Stephen Lebans's ReportToPDF' offering, but I can't download zip files.