
Signature
Smile...it is good for you! :)
This will only work in the main text story but it could be made to work in
all stories:
Sub FRUsingArrays()
Dim SearchArray As Variant
Dim ReplaceArray As Variant
Dim myRange As Range
Dim i As Long
Dim pFind As String
Dim pReplace As String
SearchArray = Array("one", "two", "three")
ReplaceArray = Array("one (1)", "two (2)", "three (3)")
Set myRange = ActiveDocument.Range
For i = LBound(SearchArray) To UBound(SearchArray)
pFind = SearchArray(i)
pReplace = ReplaceArray(i)
With myRange.Find
.Text = pFind
.Replacement.Text = pReplace
.MatchWholeWord = True
.Execute Replace:=wdReplaceAll
End With
Next
End Sub

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> The VBA Find and Replace macro is perfect, but I'm looking for a simple
> macro
[quoted text clipped - 19 lines]
>> > > Find: "Three" Replace with Three (3)"
>> > > ...and so on and so forth.
Russ - 24 Oct 2007 06:10 GMT
Macroer,
A slight modification to Graham's nice subroutine may allow for easier setup
by using only one array.
Sub FRUsingArray()
Dim SearchArray As Variant
Dim myRange As Range
Dim i As Long
Dim pFind As String
SearchArray = Array("one", "two", "three")
'The lower bound of an array created using the _
Array function is always zero. Unlike other types _
of arrays, it is not affected by the lower bound _
specified with the Option Base statement.
Set myRange = ActiveDocument.Range
For i = LBound(SearchArray) To UBound(SearchArray)
pFind = SearchArray(i)
With myRange.Find
.Text = pFind
.Replacement.Text = pFind & " (" & i + 1 & ")"
.MatchWholeWord = True
.Execute Replace:=wdReplaceAll
End With
Next
End Sub
> This will only work in the main text story but it could be made to work in
> all stories:
[quoted text clipped - 44 lines]
>>>>> Find: "Three" Replace with Three (3)"
>>>>> ...and so on and so forth.

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
Helmut Weber - 24 Oct 2007 15:35 GMT
Hi everybody,
remains the problem of the OP of
>Find: "One" Replace with "One (1)"
>Find: "Two" Replace with "Two (2)"
>Find: "Three" Replace with Three (3)"
>...and so on and so forth."<<<
which can be solved by some code written by
Greg Maxey and Doug Robbins.
http://gregmaxey.mvps.org/Spell_Out_Currency.htm

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"