• Printing to PDF (VBA/Excel/2000)

    Author
    Topic
    #416541

    Hello All
    Is anyone aware of code which will control the pathname of the PDF file being generated?

    Viewing 0 reply threads
    Author
    Replies
    • #932099

      Don,
      How are you creating the PDF? Are you using the Adobe PDF printer driver or a third party version? If it’s the Adobe version, do you have the PDFMaker.xla add-in for Excel?

      • #932114

        Hi Rory
        Thanks for the quick response. I am testing to determine the active printer, and obtaining confirmation from the user, that the correct one is active. I offer the code below. I’m running Acrobat 6 and the add-in PDFMaker.xla is attached.
        Now the cute part; I will be distributing this code in a workbook. I seek your advice on whether it will be necessary to require a specific version of Acrobat to be installed on the users’ machines. Or indeed of other pitfalls which you might think of.

        Dim loDelimiter As Long
        Dim loPDF_Posn As Long
        Dim stMsgTxt As String
        Dim stPrinter As String
        Dim byPrinterResponse As Byte
            
            ' check the printer
        ResetPrinter:
            stPrinter = Application.ActivePrinter
            loDelimiter = InStr(1, stPrinter, " on ", vbBinaryCompare)
            loPDF_Posn = InStr(1, stPrinter, "PDF ", vbTextCompare)
            If loPDF_Posn > 0 And (loPDF_Posn = 1 Or InStr(1, stPrinter, " PDF ", _
                    vbTextCompare) = loPDF_Posn - 1 And loPDF_Posn  0 Then
                If MsgBox("Are you certain that you want to print a PDF file with" & vbCrLf _
                    & stPrinter & "?", 308, myTitle) = 7 Then GoTo ResetPrinter
            End If
            
            
         
        • #932131

          You may not be able to rely on the user having PDFMaker.xla installed.

          A safer approach may be to get a copy of the Acrobat SDK from Adobe and work via the SDK.

    Viewing 0 reply threads
    Reply To: Printing to PDF (VBA/Excel/2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: