This VBA macro automates formatting a Microsoft Word document to a standard report layout.
- Sets page margins and paper size (A4)
- Applies Times New Roman font, size 12, with 1.5 line spacing and justified alignment
- Styles Heading 1, Heading 2, and Heading 3 with specific font sizes and bold formatting
- Centers all tables and inline figures in the document
- Formats figure and table captions with centered alignment, bold font, and size 12 text
- Open the Word document you want to format.
- Open the VBA editor by pressing
Alt + F11. - Insert a new module.
- Paste the macro code into the module.
- Run the macro to apply the formatting automatically.