![]() |
|
|
|
#1
|
|||
|
|||
|
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 |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perfect macro not working when its code is inserted in larger macro | RobiNew | Word VBA | 3 | 10-18-2023 03:19 AM |
| VBA code looks ugly, but works ok, needs a going over to neaten it up. | trevorc | Outlook | 0 | 04-21-2022 07:51 PM |
| Biz Case for Larger Monitors | Karen615 | Misc | 0 | 12-14-2021 01:41 PM |
| larger ribbon | Herm61 | Outlook | 0 | 05-27-2013 12:46 PM |
.OnAction only works in document with the code
|
donbexcel | Word VBA | 1 | 11-02-2011 05:25 AM |