View Single Post
 
Old 12-15-2023, 02:48 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 293
vivka is on a distinguished road
Default

Salut, RobiNew!
Code:
Sub TT()
Dim oRng As range
Set oRng = ActiveDocument.range
    With oRng.Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .text = "Title"
      .Replacement.text = ""
      .Forward = True
      .Wrap = wdFindContinue
      .Format = False
      .MatchCase = False
      .Execute
    End With
    oRng.Collapse wdCollapseEnd 'this line can be commented
    oRng.End = ActiveDocument.range.End
    oRng.Select 'this line is for testing, can be commented
    With oRng.Find
      .text = "Section"
      .Execute
    End With
     oRng.Select 'this line is for testing, can be commented
lbl_exit:
Set oRng = Nothing
Exit Sub
End Sub
Reply With Quote