Okay now the error i am getting when i run it is runtime error 462 - the remote server machine does not exist or is unavailable. It highlights
For Each myStoryRange In Word.Application.ActiveDocument.StoryRanges
which is located in this area
'Now search all other stories using Ranges
For Each myStoryRange In Word.Application.ActiveDocument.StoryRanges
Select Case myStoryRange.StoryType
Case 5, 6, 7, 8, 9
With myStoryRange.Find
.text = pfindtext
.Replacement.text = preplacetext
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With
Do While Not (myStoryRange.NextStoryRange Is Nothing)
Set myStoryRange = myStoryRange.NextStoryRange
With myStoryRange.Find
.text = pfindtext
.Replacement.text = preplacetext
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With
Loop
End Select
Next myStoryRange
Next i
Application.DisplayAlerts = True
End Sub
Bookmarks