D
David Satz
Hi. In Word 2003 with default AutoCorrect options, if a user types the
sequence --> it will be replaced in the document by Wingdings character 224,
a solid right arrow.
I need to know how a macro can find all the places where this substitution
has occurred in a document. It's easy to do interactively using the Find
dialog--just clipboard an instance of the arrow character into the "Find
What" text box, and Find finds every arrow in the document. The Find dialog
even distinguishes between arrows that came about through substitution from
"-->" and the identical looking Wingding arrow symbol. But I haven't found
any way to find these substituted characters programatically (in a macro).
Word doesn't actually apply the Wingdings font to them in the normal way,
for example. If you select the arrow, the font dropdown says "Arial" or
whatever the font originally was when the user typed the --> combination. And
searching by character code doesn't find them, either.
The Immediate window gives a similar result: typing
?Selection.Range.Font.Name gives ... whatever the font of the --> sequence
was originally (not Wingdings), with a character code of 40 for the character
itself, which would normally be a left parenthesis. But if I use the Find
object search for that font and that character code, Find never finds the
right arrow.
Curiously, the RTF code shows that the sequence --> is still preserved in
the text after the substitution has been made, and I see no indication of the
Wingdings font being applied, either--so some rather mysterious processing
must be going on, I think. Unfortunately, that bit of knowledge does me no
good; searching for the character sequence --> with the Find object doesn't
find the Wingdings arrow.
Unfortunately in the publishing company that I work for, we use HTML-style
(or XML-style) comments which need to be located by a macro, and the macro
can't "see" the end of a comment (which has the form <!-- text of comment
-->) if the writer entered it with the default AutoCorrect options set.
All help appreciated.
--best regards
sequence --> it will be replaced in the document by Wingdings character 224,
a solid right arrow.
I need to know how a macro can find all the places where this substitution
has occurred in a document. It's easy to do interactively using the Find
dialog--just clipboard an instance of the arrow character into the "Find
What" text box, and Find finds every arrow in the document. The Find dialog
even distinguishes between arrows that came about through substitution from
"-->" and the identical looking Wingding arrow symbol. But I haven't found
any way to find these substituted characters programatically (in a macro).
Word doesn't actually apply the Wingdings font to them in the normal way,
for example. If you select the arrow, the font dropdown says "Arial" or
whatever the font originally was when the user typed the --> combination. And
searching by character code doesn't find them, either.
The Immediate window gives a similar result: typing
?Selection.Range.Font.Name gives ... whatever the font of the --> sequence
was originally (not Wingdings), with a character code of 40 for the character
itself, which would normally be a left parenthesis. But if I use the Find
object search for that font and that character code, Find never finds the
right arrow.
Curiously, the RTF code shows that the sequence --> is still preserved in
the text after the substitution has been made, and I see no indication of the
Wingdings font being applied, either--so some rather mysterious processing
must be going on, I think. Unfortunately, that bit of knowledge does me no
good; searching for the character sequence --> with the Find object doesn't
find the Wingdings arrow.
Unfortunately in the publishing company that I work for, we use HTML-style
(or XML-style) comments which need to be located by a macro, and the macro
can't "see" the end of a comment (which has the form <!-- text of comment
-->) if the writer entered it with the default AutoCorrect options set.
All help appreciated.
--best regards