The following code operates (sort of) on the HTML files of a Help Project. It works fine if run stand-alone. When called as a sub, it does not work in run-time, but does work if I break at the msgbox and step through the code. When I say it doesn't work n run-time, I know that it properly fills the array, but does not perform the replaces.

One further note, it works fine if I use Selection rather than a range object. Any ideas why it would fail in run time?

<pre>Sub InternationalEnglish2()
' By Chris Green to perform
' global search/replace for International English
Dim strReplace() As String
Dim strCount As String
Dim oRan As Range
Dim intCount As Integer

' find count of search elements
Open "C:Config TestInternational.txt" For Input As #1
Do Until EOF(1)
Line Input #1, strCount
intCount = intCount + 1
intCount = intCount / 2

ReDim strReplace(0 To intCount - 1, 1)
Close #1

' fill array
Open "C:Config TestInternational.txt" For Input As #1
intCount = 0
Do Until EOF(1)
Line Input #1, strReplace(intCount, 0)
Line Input #1, strReplace(intCount, 1)
intCount = intCount + 1

MsgBox "Filled Array"

'set range and start replaces
Set oRan = ActiveDocument.Range
intCount = 0

For intCount = 0 To UBound(strReplace)
With oRan.Find
.Text = strReplace(intCount, 0)
.Replacement.Text = strReplace(intCount, 1)
.Forward = True
.Wrap = wdFindContinue
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
oRan.Find.Execute Replace:=wdReplaceAll

Close #1

End Sub