+ Reply to Thread
Results 1 to 6 of 6

Word VBA to Print multiple PDFs (using MSOffice SaveAsPDF addin) from a selected folder

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2007
    Posts
    456

    Word VBA to Print multiple PDFs (using MSOffice SaveAsPDF addin) from a selected folder

    Dear Friends,
    I would like to save n number of word files (all files from a single folder) into PDF using “MS Office 2007 Save As PDF” addin. What I am doing now is, open each file and save as PDF, which I feel a tedious task as my folder contains around 400-500 files and that too to be repeated every fortnight.
    Therefore, as the process is a repetitive in nature, I request friends to help me to find a Word VBA solution that –
    1) Ask to select the folder (that contains all word files to be saved as PDF)
    2) Converts all word files in the folder into PDF (each single file with same name) using “MS Office 2007 Save As PDF” addin.
    This will ease my half day of the work every fortnight.
    Request your kind help, please.
    Good friends are hard to find, harder to leave, and impossible to forget.

    acsishere.

  2. #2
    Forum Expert
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    1,940

    Re: Word VBA to Print multiple PDFs (using MSOffice SaveAsPDF addin) from a selected folde

    Try:
    Please Login or Register  to view this content.
    Cheers,
    Paul Edstein
    [MS MVP - Word]

  3. #3
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2007
    Posts
    456

    Re: Word VBA to Print multiple PDFs (using MSOffice SaveAsPDF addin) from a selected folde

    Dear Paul,

    Excellent & works nicely. Yet, I need to convert into PDF all word files (like .doc, docx, .docm) available in the folder. How to add it in the code? Please help me.

  4. #4
    Forum Expert
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    1,940

    Re: Word VBA to Print multiple PDFs (using MSOffice SaveAsPDF addin) from a selected folde

    You could try changing:
    strFile = Dir(strFolder & "\*.doc", vbNormal)
    to:
    strFile = Dir(strFolder & "\*.doc")

  5. #5
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2007
    Posts
    456

    Re: Word VBA to Print multiple PDFs (using MSOffice SaveAsPDF addin) from a selected folde

    Dear Macropod,
    After changing to strFile = Dir(strFolder & "\*.doc"), it is working only on .doc files.

    I wanted to convert all word files (.doc, .docx, .docm) to PDF. Pl help me.

  6. #6
    Forum Expert
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    1,940

    Re: Word VBA to Print multiple PDFs (using MSOffice SaveAsPDF addin) from a selected folde

    The original code, i.e.:
    strFile = Dir(strFolder & "\*.doc", vbNormal)
    works on .doc, .docx and .docm files. Did you actually check the output? Do note that if you have files with the same name but more than one of the .doc, .docx and .docm extensions, you'll only end up with the pdf for whichever is the last one processed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1