View Single Post
 
Old 12-12-2019, 04:31 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I'm not sure I understand what your requirements are but this might be what you are looking to do
Code:
Sub ScratchMacro()
'Modifications to Word macro originally coded by Greg Maxey
Dim oRng As Range, oRngE As Range, oRngF As Range, sFind As String
  sFind = "That Guy's Cats"
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = "Research Refs"
    .Font.Bold = True
    While .Execute
      Set oRngE = oRng.Duplicate
      oRngE.End = ActiveDocument.Range.End
      With oRngE.Find
        .Text = "§"
        .Font.Bold = True
        If .Execute Then
          oRngE.Start = oRng.Start
            Set oRngF = oRngE.Duplicate
            With oRngF.Find
              .Text = sFind
              .ClearFormatting
              If .Execute Then
                oRngE.Start = oRng.Start
                oRngE.End = oRngF.End
                'oRngE.Select
              End If
            End With
          oRngE.Delete
        End If
      End With
      oRng.Collapse wdCollapseEnd
    Wend
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote