Results 1 to 2 of 2

Thread: How to specify path to PDF Writer

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    How to specify path to PDF Writer

    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

  2. #2
    New Member
    Join Date
    Oct 2005
    Posts
    1

    Re: How to specify path to PDF Writer

    Hi, I had the same problem, but solved it, building a macro.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width