A family of Microsoft word processing software products for creating web, email, and print documents.
The compile error occurs because the .Text property and the .Replacement.Text property can each contain only one string. AFAIK, VBA does not allow multiple values separated by commas in a property assignment.
Instead of:
.Text = "O'SULLIVAN SCOT","RAMSAY/RITCHIE"
try performing a separate search and replace for each pair.
For example:
Sub Trainers_Names()
Dim rngStory As Range
For Each rngStory In ActiveDocument.StoryRanges
With rngStory.Find
.ClearFormatting
.Replacement.ClearFormatting
.Wrap = wdFindContinue
.Text = "O'SULLIVAN SCOT"
.Replacement.Text = "O'SULLIVAN SCOTT"
.Execute Replace:=wdReplaceAll
.Text = "RAMSAY/RITCHIE"
.Replacement.Text = "RAMSAY RITCHIE"
.Execute Replace:=wdReplaceAll
End With
Next rngStory
End Sub
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin