F
Fr?d?ric Laurent
Hello,
The only text in my document is :
<ABCDE><FGHIJK>lmno<PQRSTU><VWXYZ>
The purpose of this function is to get only the XML tags of the
selection.
If I manually select (highlight) <FGHIJK>mno<PQRSTU> and run this
code, I get <FGHIJK><PQRSTU><VWXYZ> when I was only expecting
<FGHIJK><PQRSTU>.
What's wrong with this??? It seems that the wdFindStop doesn't do its
job and the function searches to the end of the document (I tried with
much longer lines in the document: same problem)
Set MyRange = Selection.Range
With MyRange.Find
.Text = "\<*\>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While MyRange.Find.Execute
sXmlTagOnly = sXmlTagOnly & MyRange.Text
Loop
Thank you for your help!
Frédéric Laurent
The only text in my document is :
<ABCDE><FGHIJK>lmno<PQRSTU><VWXYZ>
The purpose of this function is to get only the XML tags of the
selection.
If I manually select (highlight) <FGHIJK>mno<PQRSTU> and run this
code, I get <FGHIJK><PQRSTU><VWXYZ> when I was only expecting
<FGHIJK><PQRSTU>.
What's wrong with this??? It seems that the wdFindStop doesn't do its
job and the function searches to the end of the document (I tried with
much longer lines in the document: same problem)
Set MyRange = Selection.Range
With MyRange.Find
.Text = "\<*\>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While MyRange.Find.Execute
sXmlTagOnly = sXmlTagOnly & MyRange.Text
Loop
Thank you for your help!
Frédéric Laurent