View Single Post
 
Old 09-30-2020, 08:24 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
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

You can either set a range at the start and select the range at the end e.g.


Code:
Dim oRng As Range
Set oRng = Selection.Range
'
'Do stuff
'
'
oRng.Select
or use ranges and don't move the selection e.g.
Code:
Sub TNR()
Dim oStory As Range
    For Each oStory In ActiveDocument.StoryRanges
        oStory.Font.Name = "Times New Roman"
        If oStory.StoryType <> wdMainTextStory Then
            While Not (oStory.NextStoryRange Is Nothing)
                Set oStory = oStory.NextStoryRange
                oStory.Font.Name = "Times New Roman"
            Wend
        End If
    Next oStory
lbl_Exit:
    Set oStory = Nothing
    Exit Sub
End Sub
__________________
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