You're still working with selections, though - your next meaningful step is:
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Quote:
And I need to run this Macro only once.
|
It seems to me that writing the macro would've taken much longer than doing the job manually. Unless you need to do this on multiple documents, there'd be a negative ROI.
That said, you can still do it with Find/Replace, by deleting the 'CTR', though typing the expression each time might be tedious - as well as being error-prone. As a macro, the F/R becomes:
Code:
Sub Demo()
With Selection
.HomeKey Unit:=wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "([!^13]@^13)(*^13)([!^13]^13)([!^13]@^13)[!^13]@^13([!^13]@^13)"
.Replacement.Text = "AN \1AC \3AH \4AL \5\2"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.Execute Replace:=wdReplaceOne
End With
End With
End Sub