VBA macro for finding extended/special characters/symbols

  • Thread starter Charlie''s odd VBA questions
  • Start date
C

Charlie''s odd VBA questions

I have written a macro to find symbols and extended characters in a Word
document. However, if a symbol is inserted, it's character code is Asc(40 or
Asc(63) as documented by MS. Word lists it as the normal text font such as
Arial even though the symbol is actually, saym Webdings. I can find it by
Find.Text = (unicode). However, even though I can find and select it, I can
not determine what the actual font of the symbol is. Since I need to copy
the symbol character, I need to know the real font name. How can I get the
real font name?

Also, is there any property or method to return the actual number of
occurrences changed when doing a Find.Replace using Continue and ReplaceAll?
Word shows it in the status bar, but I need to be able to return this count
to the macro.

Any help or suggestions would be really appreciated.
 
J

Jay Freedman

Charlie''s odd VBA questions said:
I have written a macro to find symbols and extended characters in a
Word document. However, if a symbol is inserted, it's character code
is Asc(40 or Asc(63) as documented by MS. Word lists it as the
normal text font such as Arial even though the symbol is actually,
saym Webdings. I can find it by Find.Text = (unicode). However,
even though I can find and select it, I can not determine what the
actual font of the symbol is. Since I need to copy the symbol
character, I need to know the real font name. How can I get the real
font name?

Also, is there any property or method to return the actual number of
occurrences changed when doing a Find.Replace using Continue and
ReplaceAll? Word shows it in the status bar, but I need to be able to
return this count to the macro.

Any help or suggestions would be really appreciated.

Have a look at http://word.mvps.org/FAQs/MacrosVBA/FindReplaceSymbols.htm.
 
K

Klaus Linke

Hi Charlie,

Probably the article Jay mentioned will answer your immediate question: If you select the character and open "Insert > Symbol", it should tell you the font.

You can also use the macro from the thread http://groups-beta.google.com/group...e_frm/thread/4ff56641a0175fb/43be18bf4c8700ed
to turn the symbols into regular characters that you can find/replace. They'll have codes in the Unicode block U+F000.

The macro fails in some rare cases. One such case is when a doc had symbol fields and was saved in RTF format: The symbol fields are turned into symbols, but they don't act as they should.
I haven't found a solution for those cases yet.

Regards,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top