+ 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 2016
    Posts
    582

    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 macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    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
    [Fmr MS MVP - Word]

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

    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 macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    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 2016
    Posts
    582

    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 macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    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)

Similar Threads

  1. How can I generate a code to print out a folder with word documents?
    By QuintonMcCloud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2015, 09:07 AM
  2. Replies: 1
    Last Post: 12-19-2014, 01:40 PM
  3. With excel to print a selected page from a word document
    By eb4927 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-15-2014, 05:54 PM
  4. [SOLVED] Code to print all word documents from a folder
    By Scal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2013, 04:44 PM
  5. [SOLVED] Attaching PDFs in a folder to an email.
    By yeahyeahyeah in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-02-2012, 06:02 PM
  6. Macro to print multiple worksheets to multiple PDFs.
    By ryanwood17 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2010, 02:07 AM
  7. Macro to save shared addin to personal addin folder
    By MrStyx in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-31-2008, 10:13 AM

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