Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Elkins Park, Pennsylvania, USA
    Posts
    325
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Symbol Objects? (Word XP VBA)

    Does anyone know exactly what Word puts in your text when you use the "Insert: Symbol" command? I know symbols entered with the "(normal font)" option are straight ANSI or UNICODE characters, but what goes on when you select "Wingdings" or "Symbol"? It seems to create something like an embedded object. But more to the point, how can I tell what that "character" is if I'm looping through each character in the paragraph/selection/range?
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Symbol Objects? (Word XP VBA)

    If you use Insert | Symbol, Word does a very good job of hiding the inner workings from the user, even in VBA. The symbol is "just" a character, not an object. You can get its ANSI value the normal way, but the font you use, such as Symbol or Wingdings, is invisible - you'll just get the font used for the rest of the text. Apparently nothing is put in the text itself, it's all done in the metadata.

    Perhaps Klaus Linke will be able to provide more information.

  3. #3
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Elkins Park, Pennsylvania, USA
    Posts
    325
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Symbol Objects? (Word XP VBA)

    Well... I know I can get the text that is displayed, but I should have gone into more detail. The main thing I need to be able to do is use VB to read the text from a given paragraph, character-by-character, and pass it to a string which will be used to create an HTML/XML document.
    When I'm looping through the characters in the paragraph, the character value returned by both the ASC() and ASCW() functions, when it hits a symbol, is "40", or a left parenthesis. (To illustrate, use Insert: Symbol to insert the greater-than-or-less-than symbol in the Symbol font and use VBA to get the ASC value of the character.) A somewhat related problem is that I cannot use code to search for specific "characters" entered in this fashion, either.
    (Because a symbol entered this way will launch the "Insert: Symbol" dialog box, I kind of think of it as an embedded object.)
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Symbol Objects? (Word XP VBA)

    Maybe you'll find this useful: Finding and replacing symbols on the Word MVP site.

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Symbol Objects? (Word XP VBA)

    Some of Klaus' wisdom can be found in these Lounge threads:

    Character Maps + Unicode (97+)
    Finding Special Characters (Word97 and up)

  6. #6
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Elkins Park, Pennsylvania, USA
    Posts
    325
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Symbol Objects? (Word XP VBA)

    Man, you guys are good. This is what the "Help Desk" here at work should be like!
    Thanks, all...
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •