View Single Post
 
Old 12-01-2023, 03:59 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,439
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

RobiNew,


I have a bit of fixed code in my normal module. In most of my projects, whenever I want to do a find and replace, I call it



Code:
Sub Replace1()
Dim aRng As Range
   ResetFRParameters
   Set aRng = ActiveDocument.StoryRanges(1)
     With aRng.Find 
        .Text = "(^0146)" & "(^0171)" '« (146=’) 
        .Replacement.Text = "\1" & "^0187" '» 
        .MatchWildcards = True   
        .Execute Replace:=wdReplaceAl
     End With
End Sub

Code:
Sub ResetFRParameters()
 With Selection.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Text = ""
  .Replacement.Text = ""
  .Forward = True
  .Wrap = wdFindStop
  .Format = False
  .MatchCase = False
  .MatchWholeWord = False
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
  .Execute
End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote