Results 1 to 2 of 2

PDFCreator using default settings, not VBA assigned settings.

This is a discussion on PDFCreator using default settings, not VBA assigned settings. within the Excel Questions forums, part of the Question Forums category; The code below runs without any errors, but it prints to the PDFCreator default settings (my documents, with the filename ...

  1. #1
    New Member
    Join Date
    Oct 2009
    Posts
    10

    Default PDFCreator using default settings, not VBA assigned settings.

    The code below runs without any errors, but it prints to the PDFCreator default settings (my documents, with the filename being the title of the document) instead of the settings that I assign to the pdfcreator object in the code.

    I have my windows default printer set to the pdfcreator because to my knowledge you cant assign a different printer with execwb.

    My purpose is to print to pdf about 1000 html pages. And I have to do this within IE because the pages have non-printing sections so they look different when printed than when viewed normally.

    Any ideas why my settings are not working here? I never get anything in the C:\mytemp folder, and the name is never right. In fact, since I already have the default printer set to pdfcreator, the code below works exactly the same as if I had removed all references to the pdfcreator object.

    Is there something in the pdfcreator UI that I have to enable to allow other programs to adjust its settings? As you can see below, I even tried printing the active page to see if the pdfcreator object only worked when using excel, but that also printed to the default directory, and not the one in the code.

    Any help is greatly appreciated, thankyou!

    PHP Code:
    Sub Test_Printer()
       
    mypage "http://www.google.com"
       
    pdfname "testpdf"
       
    Call PrintIE(mypagepdfname)
    End Sub
     
    Private Sub PrintIE(addressoutName)
    Set IE CreateObject("InternetExplorer.Application")
    Dim PDFCreator1 As PDFCreator.clsPDFCreator
    Set PDFCreator1 
    = New clsPDFCreator
    With PDFCreator1
        
    If .cStart("/NoProcessingAtStartup") = False Then
            MsgBox 
    "Can't initialize PDFCreator."
            
    End
        End 
    If
        .
    cOption("UseAutosave") = 1
        
    .cOption("UseAutosaveDirectory") = 1
        
    .cOption("AutosaveDirectory") = "c:\mytemp\"
        .cOption("
    AutosaveFilename") = outName
        .cOption("
    AutosaveFormat") = 0 '= PDF
        .cClearCache
    End With
    'test to check if pdfprinting works in excel correctly
    'even within excel, the PDFCreator uses its default settings and not the ones assigned above.
    'ActiveSheet.PrintOut Copies:=1, ActivePrinter:="
    PDFCreator"
    'code to open web address and wait for it to finish loading
    IE.navigate address
    Do While IE.Busy
        DoEvents
    Loop
    Do While IE.ReadyState <> 4
        DoEvents
    Loop
    'reminder to add code for setting and resetting default printer (currently using 'PDFCreator' as windows default)
    'print from internet explorer, do not query user (uses default printer)
    IE.ExecWB 6, 2
    Set IE = Nothing
    PDFCreator1.cClose
    Set PDFCreator1 = Nothing
    End Sub 

  2. #2
    New Member
    Join Date
    Oct 2009
    Posts
    10

    Default Re: PDFCreator using default settings, not VBA assigned settings.

    Just a bump to put some more eyes on this before I try a linked cross-post tomorrow.

    Would I have better luck on the PDFCreator forums?

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com