Microsoft Word 2013 VBA macro that converts all Word files in a folder to PDF in one batch.
- Select a folder, convert every Word file inside to PDF
- Supported formats:
- Word documents: .doc, .docx, .docm
- Word templates: .dot, .dotx, .dotm
- Word-compatible: .odt, .rtf
- Files opened hidden and read-only — no visual flickering, no accidental edits
- PDFs saved in the same folder as originals
- PDF bookmarks created from Word headings
- Shows summary with success/failure count
- Opens output folder in Explorer when done
- Microsoft Word 2013 (or later)
- Windows
- Open Word 2013
- Press Alt+F11 to open the VBA editor
- File → Import File → select
WordBatchPDF.bas - Close the VBA editor
- Alt+F8 to open the Macros dialog
- Select WordBatchPDF.BatchWordToPDF
- Click Run
- Select a folder containing Word files
- Wait — progress is shown in the status bar
- A summary dialog shows results
- The output folder opens automatically in Explorer
Before: C:\Projekty\Sprawozdanie.docx
C:\Projekty\Umowa.doc
C:\Projekty\Zalacznik.odt
After: C:\Projekty\Sprawozdanie.pdf
C:\Projekty\Umowa.pdf
C:\Projekty\Zalacznik.pdf
| Problem | Solution |
|---|---|
| "No Word files found" | Folder is empty or contains unsupported file types |
| File fails to convert | File may be corrupted, password-protected, or from an incompatible format |
| Word security warning | Enable macros in File → Options → Trust Center → Macro Settings |
| Can't find the macro | Check module name: WordBatchPDF, macro name: BatchWordToPDF |
| File | What |
|---|---|
WordBatchPDF.bas |
VBA source — import into Word via Alt+F11 → File → Import File |
README.md |
This file |
MIT License