I really don't know, Paul. As I said before, I'm totally illiterate in VBA. Programming is for the young and adventurous ones, I'm too old for learning now. All I know of macros is using them. I was simply copying and trying them as per the instructions from the post you sent. To follow Robert's idea I first tested it and later I used the Record Macro button and executed the procedure by hand. And now the macro works right. Here is the code Word recorded automatically:
Sub CleanUpPDFText2()
'
' CleanUpPDFText2 Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "(^13)([a-z])"
.Replacement.Text = "^32\2"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
_______________
Cheers
Rick
|