A problem when using find and replace to find special fonts

S

songq

I want to split a paragraph into several parts,with each
part has uniform font.so i use find and replace to do this.
'set R = range of one paragraph
Dim EndPoint As Integer
EndPoint = R.End
Do While(R.Start<R.End)
With R.Find
.ClearFormatting
.Font.color = R.Characters(1).Font.color
.Font.name = R.Characters(1).Font.name
.Font.Bold = R.Characters(1).Font.Bold
.Font.Italic = R.Characters(1).Font.Italic
.Font.Size = R.Characters(1).Font.Size
.text = ""
.Replacement.text = ""
.Format = True
.Forward = True
.Execute
End With
Debug.Print R.text
R.SetRange R.End,EndPoint
Loop

but it doesn't work properly,and who can tell me what's
wrong with my program.Thank you very much!
 
W

Word Heretic

G'day "songq" <[email protected]>,

use a wildcard search with text="*"


songq said:
I want to split a paragraph into several parts,with each
part has uniform font.so i use find and replace to do this.
'set R = range of one paragraph
Dim EndPoint As Integer
EndPoint = R.End
Do While(R.Start<R.End)
With R.Find
.ClearFormatting
.Font.color = R.Characters(1).Font.color
.Font.name = R.Characters(1).Font.name
.Font.Bold = R.Characters(1).Font.Bold
.Font.Italic = R.Characters(1).Font.Italic
.Font.Size = R.Characters(1).Font.Size
.text = ""
.Replacement.text = ""
.Format = True
.Forward = True
.Execute
End With
Debug.Print R.text
R.SetRange R.End,EndPoint
Loop

but it doesn't work properly,and who can tell me what's
wrong with my program.Thank you very much!

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

Replies offlist may require payment.
 
Top