Results 1 to 4 of 4

Thread: Export to .pdf

  1. #1
    Join Date
    Jan 2003
    Location
    NJ
    Posts
    4

    Question Unanswered: Export to .pdf

    Is there a way to prigrammaticaly pick a specific printer(Acrobat Distiller) from the list of printers? I need to print my screen shot from Access 2000 front end to .pdf file. I have Acrobat Distiller 5. installed. Any suggestions?

  2. #2
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251

    Re: Export to .pdf

    AccessXP is very easy - it has PRINTER object ....

    in older versions you can use this.... (maybe somebody has better solution).


    Sub SetDefaultPrinter(InputPrinter As String)
    Dim WSHNetwork As Object
    Set WSHNetwork = CreateObject("WScript.Network")
    WSHNetwork.SetDefaultPrinter InputPrinter
    Set WSHNetwork = Nothing
    End Sub


    Sub ListAllPrinterinNetwork()
    Dim WSHNetwork As Object
    Dim oPrinters As Object
    Dim i As Byte

    Set WSHNetwork = CreateObject("WScript.Network")
    Set oPrinters = WSHNetwork.EnumPrinterConnections
    For i = 0 To oPrinters.Count - 1
    Debug.Print oPrinters.Item(i)
    Next
    End Sub


    Public Function GetDefaultPrinterName() As String
    ' this was tested for WinNT4 and Win2k, Win98 can have different registry ....
    Dim WshShell As Object
    Set WshShell = CreateObject("WScript.Shell")
    GetDefaultPrinterName = WshShell.RegRead("HKEY_CURRENT_USER\Software\micro soft\windows nt\currentversion\windows\device")
    GetDefaultPrinterName = Left(GetDefaultPrinterName, InStr(1, GetDefaultPrinterName, ",winspool") - 1)
    Set WshShell = Nothing
    End Function


    jiri

  3. #3
    Join Date
    Jan 2003
    Location
    NJ
    Posts
    4

    Thumbs up Thanks

    Thanks a lot, it's working great!

  4. #4
    Join Date
    Jan 2004
    Posts
    1

    Thumbs up

    Nice bit of code by Playernovis. Do you know how to programatically reset the default directory for Acrobat Distiller at the same time?

Posting Permissions

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