Hello, all, this is driving me nuts, so I thought I'd give the gurus a try.
I have a VB6 program which opens an access 97 database and prints a report to PDF. The program will run fine all the way up until it needs to save the PDF at which point the save as dialogue box comes up. I've searched this forum and the net for answers but to no avail. Is there a way to specify the path at which the Adobe PDF writer saves the PDF to in the code? Here is my code below:
VB Code:
Sub Main() 'Reference to MS Access 97 library Dim X As Long Dim prt As Printer Dim acc As Access.Application Dim rpt As Report For Each prt In Printers If Printers(X).DeviceName = "Acrobat PDFWriter" Then Exit For X = X + 1 Next Set prt = Printers(X) Set acc = New Access.Application acc.OpenCurrentDatabase ("J:\Cust_Support.mdb") acc.DoCmd.OpenReport "test", acViewNormal 'acViewNormal means the report is just printed. 'File dialogue appears here. I want it to save to a path I specify in the code. acc.CloseCurrentDatabase Set prt = Nothing Set acc = Nothing End Sub




Reply With Quote