Announcement

Collapse
No announcement yet.

Suppress Save dialog when using Foxit PDF from Excel VBA

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Suppress Save dialog when using Foxit PDF from Excel VBA

    Im wanting to automate printing my excel worksheets to PDF using "Foxit Reader PDF Printer". I have the following VBA code that i amusing:

    ActiveWindow.SelectedSheets.PrintOut _
    Copies:=1, _
    Preview:=False, _
    ActivePrinter:="Foxit Reader PDF Printer", _
    PrintToFile:=True, _
    PrToFileName:="D:\!NICS\Documents\! WORK\INVOICES\test9.pdf", _
    IgnorePrintAreas:=True

    Even though I have specified 'PrintToFile'= True' and have the "PrToFileName" path and name filled in, it still pops up a dialog box which I would like to bypass, is this possible?

    When using microsofts built in "Microsoft Print to PDF" printer it does not bring up any dialog box and saves the pdf accordingly, but has a much larger file size.

    I have also downloaded the Foxit Reader SDK Lib but am not sure if I can use this from Excel VBA to do what I want. I assume this is only used to drive Foxit PDF program?


  • #2
    Hi niczoom,

    Sorry, now Foxit Reader does not support Excel VBA, but I have reported your requirement to our team, they will consider it in future version, report ID:Phantom-484

    Would you please add the target folder and check the option"Use default filename and save to default folder" in Foxit printer properties dialog box, then you will not get save dialog box?

    Comment


    • #3
      Thanks for the reply.

      I did as you mentioned and also setup the target folder. But, the way i currently have my invoices setup, which is on individual sheets in excel does not work with this method.

      As mentioned before, using excels vba 'PrintOut' method, which lets me set the output path and filename, but foxit does not take this into account when printing using the ActivePrinter:="Foxit Reader PDF Printer". It would be great to use foxit in this way, hopefully, as you mentioned, the foxit team will support this in a future version.

      But I believe I can use what u suggested, if I set the option "Use default filename and save to default folder" along with a target folder. I can rework my vba code to individually save each invoice as a seperate xls file, then rename this file to reflect the invoice details then reload it and print if using Foxit with the option "Use default filename and save to default folder" checked.

      I do prefer foxit as the file size is much smaller, approx 65kB vs 230kB for "Microsoft Print to PDF".

      Comment


      • #4
        Hi Niczoom,

        Thank you for your feedback, it is a good news that the workaround helps you.

        Comment


        • #5
          Hello, I have the exact same question and want to know if you have made any progress on this subject.

          I really prefer foxit pdf printer to microsoft PDF printer and I also want to set the name from VBA.

          Thank you for your help!

          Comment


          • #6
            Originally posted by easytherm View Post
            Hello, I have the exact same question and want to know if you have made any progress on this subject.

            I really prefer foxit pdf printer to microsoft PDF printer and I also want to set the name from VBA.

            Thank you for your help!
            Dear easytherm,

            Thanks for your post.Foxit PhantomPDF will support Excel VBA in the next major release version 9.0 if everything goes well. Please keep an eye out for the new major version.




            Comment

            Working...
            X