P
pavon
I want to use find and replace to find characters in a
paragraph which have same font with the first character
and adjacent to the first character.for example,
one paragraph:"abcd",fonts of 'a' and 'b' are completely
same,including font name,font size,font color,bold or
not,italic or not.
but fonts of 'b' and 'c' are different.so the expected
output of my program is "ab".and my program really works
when meeting english characters,but it doesn't work with
chinese characters,even i set the find.LanguageID =
wdSimplifiedChinese
here is the source code of my program
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 = ""
.MatchCase = False
.MatchWildcards = False
.MatchWholeWord = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Wrap = wdFindStop
.Format = True
.Forward = True
If (.Execute = True) Then
Debug.Print "Find!!!"
End If
End With
Debug.Print R.text
could anybody tell me what's wrong with my program,or
there are some bugs with the "Find and Replace",thanks a
lot!
paragraph which have same font with the first character
and adjacent to the first character.for example,
one paragraph:"abcd",fonts of 'a' and 'b' are completely
same,including font name,font size,font color,bold or
not,italic or not.
but fonts of 'b' and 'c' are different.so the expected
output of my program is "ab".and my program really works
when meeting english characters,but it doesn't work with
chinese characters,even i set the find.LanguageID =
wdSimplifiedChinese
here is the source code of my program
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 = ""
.MatchCase = False
.MatchWildcards = False
.MatchWholeWord = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Wrap = wdFindStop
.Format = True
.Forward = True
If (.Execute = True) Then
Debug.Print "Find!!!"
End If
End With
Debug.Print R.text
could anybody tell me what's wrong with my program,or
there are some bugs with the "Find and Replace",thanks a
lot!