Record your first macro
- Developer → Record Macro, name it, then perform your actions;
- Stop recording; the steps are saved as VBA;
- Developer → Macros to run it or bind it to a button.
Example: bold every heading
For Each p In ActiveDocument.Paragraphs
If p.Style = "Heading 2" Then p.Range.Bold = True
Next
Safety
Macros can carry malicious code: run only your own or trusted ones, and set macro security to disable unsigned macros.