View Single Post
 
Old 07-21-2023, 09:24 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
                .Font.Name = "Arial"
                Do While .Execute
                    oStory.Font.Name = "Trebuchet MS"
                Loop
            End With
        If oStory.StoryType <> wdMainTextStory Then
            While Not (oStory.NextStoryRange Is Nothing)
                Set oStory = oStory.NextStoryRange
                With oStory.Find
                    .Font.Name = "Arial"
                    Do While .Execute
                        oStory.Font.Name = "Trebuchet MS"
                    Loop
                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
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote