To convert a folder full of Word documents (.doc or .docx) into PDFs, here’s a simple guide using different methods depending on your setup:
Method 1: Using Microsoft Word (Windows) with VBA Script
If you have Microsoft Word installed on Windows, you can automate the conversion with a VBA macro:
-
Open Word, press Alt + F11 to open the VBA editor.
-
Insert a new module (Insert > Module).
-
Paste this code:
-
Modify the
folderPathto your folder location. -
Run the macro (F5).
-
All Word files in the folder will be saved as PDFs in the same folder.
Method 2: Using Python with python-docx and comtypes (Windows)
Python can automate Word to PDF conversion via COM interface on Windows:
Make sure to have Python and comtypes installed (pip install comtypes).
Method 3: Using LibreOffice (Cross-Platform)
LibreOffice can convert docs to PDFs via command line:
Steps:
-
Install LibreOffice.
-
Open terminal or command prompt.
-
Navigate to your folder with Word docs.
-
Run the command above.
-
PDFs will be created in the specified output directory.
Summary
-
Windows + MS Word: Use VBA macro or Python COM automation.
-
Cross-platform: Use LibreOffice command line.
-
Batch process by pointing scripts to the folder location.
Let me know if you want the code customized for your OS or need help running these!