none
use VBA to save a web page as PDF RRS feed

  • Question

  • My Office application is using VBA to open an IE page, fill in fields, then submit the results. I'd like to save the result page as a .pdf file. Is there a way to do this from Microsoft Office? Or do I need to purchase PDF creating software (like Adobe)?
    Monday, May 4, 2015 10:38 PM

Answers

  • Hi

    >> I'd like to save the result page as a .pdf file. Is there a way to do this from Microsoft Office? Or do I need to purchase PDF creating software (like Adobe)?

    I’m afraid in Office development, there isn’t an Office object could support saving a Web page as PDF, but you could operate InternetExplorer.Application object to print the web page as a PDF. I will recommend you post a thread in VBA forum, more professional members will be involved , which will help you solve this issue more effectively.

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Thank you for your understanding.

    Best Regards

    Lan


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by L.HlModerator Tuesday, May 19, 2015 5:16 AM
    Wednesday, May 6, 2015 1:35 AM
    Moderator

All replies

  • Looks like Selenium wrapper does it with

    selenium-vba https://code.google.com/p/selenium-vba/


    Tuesday, May 5, 2015 11:28 PM
  • Hi

    >> I'd like to save the result page as a .pdf file. Is there a way to do this from Microsoft Office? Or do I need to purchase PDF creating software (like Adobe)?

    I’m afraid in Office development, there isn’t an Office object could support saving a Web page as PDF, but you could operate InternetExplorer.Application object to print the web page as a PDF. I will recommend you post a thread in VBA forum, more professional members will be involved , which will help you solve this issue more effectively.

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Thank you for your understanding.

    Best Regards

    Lan


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by L.HlModerator Tuesday, May 19, 2015 5:16 AM
    Wednesday, May 6, 2015 1:35 AM
    Moderator
  • I was thinking that since this is a VBA related question that applies to all Office applications, it should go in this "General Office" forum. But apparently that's not what it's for. Sorry for the confusion.

    Everything I saw in the VBA forums about saving an IE screen as a PDF file involved printing it to a PDF printer. Install a PDF printer, switch to it, after printing set the default printer back, etc. The Selenium Wrapper just saves the screen directly as a PDF -- much simpler than the "print to PDF" approach. So I'm going to stay with Selenium, I think.

    Wednesday, May 6, 2015 1:40 PM