Thursday, December 5, 2024

Microsoft Word useful macro

 If you frequently need to standardize fonts, you can use a VBA macro:

  1. Enable Developer Tab:

    • Go to File > Options > Customize Ribbon, and check the Developer tab.
  2. Run a Macro:

    • Press Alt+F11 to open the VBA editor.
    • Click Insert > Module and paste the following code:

      Sub SetFontForEntireDocument() Dim para As Paragraph For Each para In ActiveDocument.Paragraphs para.Range.Font.Name = "Arial" para.Range.Font.Size = 12 Next para End Sub
    • Replace YourFontName and YourFontSize with your preferred font and size.
    • Press F5 to run the macro.

No comments:

Post a Comment

Beogradsko programiranje=