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:
  1. Sub Main()
  2.  
  3. 'Reference to MS Access 97 library
  4. Dim X As Long
  5. Dim prt As Printer
  6. Dim acc As Access.Application
  7. Dim rpt As Report
  8.  
  9. For Each prt In Printers
  10.     If Printers(X).DeviceName = "Acrobat PDFWriter" Then Exit For
  11.     X = X + 1
  12. Next
  13.  
  14.     Set prt = Printers(X)
  15.  
  16. Set acc = New Access.Application
  17. acc.OpenCurrentDatabase ("J:\Cust_Support.mdb")
  18.  
  19. acc.DoCmd.OpenReport "test", acViewNormal 'acViewNormal means the report is just printed.
  20. 'File dialogue appears here.  I want it to save to a path I specify in the code.
  21.    
  22. acc.CloseCurrentDatabase
  23.     Set prt = Nothing
  24.     Set acc = Nothing
  25.  
  26. End Sub