+ Reply to Thread
Results 1 to 14 of 14

How to convert all word files stored in the folder to PDF automatically?

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    How to convert all word files stored in the folder to PDF automatically?

    Hi friends,

    I want to convert all the word files to PDF store in the folder ‘OUTPUT’ store on ‘C’ drive. I have posted the thread on excel programming forum. Please see it and suggest me a concrete solution at the earliest. It is very urgent for me.

    http://www.excelforum.com/excel-prog...ml#post4228940

    Any help will be highly appreciated.

    Thanking you in anticipation.
    Sincerely,

    mso3

  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,835

    Re: How to convert all word files stored in the folder to PDF automatically?

    It's not clear from your post whether the files are already in the Output folder, or somewhere else. The following macro lets you choose any source folder:
    Please Login or Register  to view this content.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to convert all word files stored in the folder to PDF automatically?

    Hi Paul,

    Thank you.

    I’m getting run-time error 438 object doesn’t support this property or method.

    All the word files are already stored in the ‘output’ folder.
    After opening the folder I want to convert all the word files in the folder to pdf one by one. If possible delete the word files after creating pdf files.

    Hope this will help you to amend the code properly.

    Thank you.

  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,835

    Re: How to convert all word files stored in the folder to PDF automatically?

    On what code line are you getting the error message, and what Word version are you using?

  5. #5
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to convert all word files stored in the folder to PDF automatically?

    Hi Paul,
    I’m getting error on the following line.

    Please Login or Register  to view this content.
    I’m using m. s. office word 2007.
    Steps:
    First click the macro
    Dialog to select the word files to convert pdf
    after converting word to pdf
    Delete word file

    Final output will be the pdf files in the output folder in place of word files. In this case there are 5 word files in the ‘output’ folder, so there will be 5 pdf files in the ‘output’ folder and all the 5 word files will be deleted.

    Thank you.
    Attached Files Attached Files
    Last edited by mso3; 10-30-2015 at 05:49 AM.

  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,835

    Re: How to convert all word files stored in the folder to PDF automatically?

    The SaveAs2 method wasn't introduced til Office 2010. You may be able to achieve the same result using SaveAs instead.

  7. #7
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to convert all word files stored in the folder to PDF automatically?

    Hi Paul,

    I removed 2 from SaveAs2 and now getting run-time error 4198 command fail.

    Thank you.

  8. #8
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,835

    Re: How to convert all word files stored in the folder to PDF automatically?

    Does your "C:\Output\" folder exist? Do you have write permissions to it?

  9. #9
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to convert all word files stored in the folder to PDF automatically?

    Hi Paul,

    Good morning!

    Now I change the folder path and recorded the macro which is working fine for first ‘A’ file but I want to convert all the files in the folder ‘OUTPUT’ to PDF.
    However there are few amendmenttts are require as follows:

    After opening the folder I want to convert all the files in the folder to pdf one by one automatically.
    I don’t want any alerts to replace the existing file. It should automatically replace while saving automatically.
    I don’t want to choose the file name of pdf file. It should be automatically.

    I think after this amendments the program will work fine positively.

    Please Login or Register  to view this content.
    Sorry for trouble.

    Thank you and have a nice day.

  10. #10
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,835

    Re: How to convert all word files stored in the folder to PDF automatically?

    The code I provided in post #2 is all you should need - aside from changing SaveAs2 to SaveAs. That said, I see from post #9 you're actually using a different folder to the one you said you were using in post #1. You can't expect the code to work properly if you provide the wrong information...

    In the code I provided in post #2, you could change:
    Please Login or Register  to view this content.
    to:
    Please Login or Register  to view this content.
    As for the other code you posted in post #9, that uses a 3rd-party PDF driver, apparently named "doPDF 8". I have no experience with that product, no idea of whether it's even programmable vis-à-vis the filenames & overwriting, and I'm not going to invest any time in something that isn't necessary to get the job done.

  11. #11
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to convert all word files stored in the folder to PDF automatically?

    Hi Paul,

    Please don’t mind. Due to a technical problem the problem was occurring. So I change the path. Now the technical problem is solved by the computer engineer successfully.

    Excellent! The program is working fine.

    I by heart appreciate you for the same.

    Only last question:
    At present we have to choose the folder to create pdf files. Is it possible to make an ‘OUTPUT’ folder as a default folder and skip the choose folder dialog?
    If it’s not possible then leave it. I will manually choose it.

    Please let me know then I will mark the thread solved today.

    Thank you for your kind assistance.

  12. #12
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,835

    Re: How to convert all word files stored in the folder to PDF automatically?

    Try:
    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to convert all word files stored in the folder to PDF automatically?

    Hi Paul,

    Excellent! Perfect as per requirement.

    Thank you for sparing a lot of time to solve my problem.

    Thank you and have a nice day.

  14. #14
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to convert all word files stored in the folder to PDF automatically?

    Hi Paul,

    The code is working fine but I’m facing a file name problem today as follows:

    If the file name of word file is ‘Mrs. Fisher Sally.docx’ then after converting it to pdf change to ‘Mrs.pdf’. Because of this problem I’m unable to attach the pdf file to the mail as attachment. Without matching the file name it’s not possible to attach the file as attachment.

    I don’t want to change the original file name. Please suggest me a solution.

    Sorry for trouble.

    Thanking you.

+ 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. [SOLVED] Help request to convert all the word files to PDF stored in a folder
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2016, 07:06 AM
  2. problem with macro - trying to extract subjects from .msg files stored in folder
    By mwilkes in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2013, 07:06 PM
  3. Word browsing folder and open txt files in word document.
    By naseerrahaman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2013, 03:38 AM
  4. [SOLVED] How to Extract .zip files stored in a folder using VBA
    By zaska in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2012, 01:24 PM
  5. Convert all .txt files to .xls in folder
    By natalie1230 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-19-2011, 03:50 AM
  6. Convert all txt files in Folder to csv
    By nms2130 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2011, 11:14 AM
  7. Copy a row from 3000 excel files stored in a folder and paste it in a new workbook
    By hubertus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-28-2009, 10:34 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