Of course. Here's the code:
Sub restyleSelection()
Dim r As Range
Set r = Selection.Range
r.Find.Style = ActiveDocument.Styles("Default Paragraph Font")
r.Find.Replacement.Style = ActiveDocument.Styles("Emphasis")
With r.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
r.Find.Execute Replace:=wdReplaceAll
End Sub
I created a test version of the macro that uses buitin Word styles. If you
create a new document and add a few paragraphs of dummy text, then select
a few words in a paragraph and run the macro, you'll see that the Emphasis
character style is applied beyond the ending boundary of the range and to
the end of the document.
FWIW, I also tested this with the Find/Replace feature itself and got the
same results. Although Find/Replace operates on the selection by default
for most things, this swapping of styles applies beyond the selection.
This leads me to believe I may need to look for another solution beyond
the Find/Replace feature.
--
Paul Burton