View Single Post
 
Old 05-01-2021, 11:54 PM
Guessed's Avatar
Guessed Guessed is online now Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,994
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

Firstly, there is a commonality there so you could search for "E:^t"
Secondly, you can replace formatting with a find but if you do, the actual text replacement doesn't happen at the same time. So I would do it with a pair of replacements - first just doing the formatting change, second doing the text change.
Code:
Sub CleanUp()
  Dim oRng As Word.Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .MatchCase = True
    .Text = "E:^t"
    .Replacement.ParagraphFormat.LeftIndent = InchesToPoints(0)
    .Execute Replace:=wdReplaceAll
    .Replacement.ClearFormatting
    .Replacement.Text = "E:  "
    .Execute Replace:=wdReplaceAll
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote