View Single Post
 
Old 09-14-2023, 12:58 AM
profitbookie profitbookie is offline Windows 11 Office 2016
Novice
 
Join Date: Sep 2023
Posts: 4
profitbookie is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
In the context of the thread
Code:
Function ChangeFont(oDoc As Document) As Boolean
Dim oStory As Range
    On Error GoTo err_Handler
    For Each oStory In oDoc.StoryRanges
            With oStory.Find
                .ClearFormatting
                .Replacement.ClearFormatting
                .Font.Size = 14
                .Replacement.Font.Size = 8
                .Execute Replace:=wdReplaceAll
            End With
        If oStory.StoryType <> wdMainTextStory Then
            While Not (oStory.NextStoryRange Is Nothing)
                Set oStory = oStory.NextStoryRange
                With oStory.Find
                    .ClearFormatting
                    .Replacement.ClearFormatting
                    .Font.Size = 14
                    .Replacement.Font.Size = 8
                    .Execute Replace:=wdReplaceAll
                End With
            Wend
        End If
    Next oStory
    Set oStory = Nothing
    ChangeFont = True
lbl_Exit:
    Exit Function
err_Handler:
    ChangeFont = False
    Resume lbl_Exit
End Function

Where do I enter this code?
Reply With Quote