C
Charlie Mac
I have a routine that scans a document for character patterns to
locate specific words. Some documents contain hidden control
characters that will cancel the scan. I am using this code to rid
these characters, but I do not know what additional character codes to
remove. I cannot use the clearformatting command for the whole
document as the document's formatting (e.g. bold and italics) would be
history. Please help.
Fray(1, 1) = "^13"
Fray(1, 2) = "^p"
Dim MyRange As Range
Set MyRange = Selection.Range
MyRange.WholeStory
For Eye = 1 To 10
With Selection.Find
.Text = Fray(Eye, 1)
.Replacement.Text = Fray(Eye, 2)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.Execute Replace:=wdReplaceAll
End With
Next Eye
Thank you.
Charlie from Texas
locate specific words. Some documents contain hidden control
characters that will cancel the scan. I am using this code to rid
these characters, but I do not know what additional character codes to
remove. I cannot use the clearformatting command for the whole
document as the document's formatting (e.g. bold and italics) would be
history. Please help.
Fray(1, 1) = "^13"
Fray(1, 2) = "^p"
Dim MyRange As Range
Set MyRange = Selection.Range
MyRange.WholeStory
For Eye = 1 To 10
With Selection.Find
.Text = Fray(Eye, 1)
.Replacement.Text = Fray(Eye, 2)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.Execute Replace:=wdReplaceAll
End With
Next Eye
Thank you.
Charlie from Texas