Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Pennsylvania, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inserting Unicode characters in a macro (Word 2002 SP3)

    I need to write a macro to replace occurrences of a certain character with Unicode value 9250 (decimal), which is a standard symbol used to represent a blank space. I create the symbol in document by pressing ALT+9250, which produces the symbol from the Lucida Sans Unicode font. But I can't find how to create the character in code. The ChrW function produces a character that appears onscreen as a box (undisplayable character?), but VBA seems to think that this "box" is actually an ASCII 63. I have no idea why.

    So, in summary, I need to replace character X with a Unicode character 9250. Does anyone know how? I'd be all too happy to do it using the Find/Replace feature, but it doesn't seem possible that way. Thanks for any help.

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

    Re: Inserting Unicode characters in a macro (Word 2002 SP3)

    For me, using ChrW(9250) in VBA code results in the same character in the document as typing Alt+9250 directly into the document. The character is attached below.
    Attached Images Attached Images
    • File Type: png x.png (1.2 KB, 4 views)

  3. #3
    Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Pennsylvania, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Inserting Unicode characters in a macro (Word

    Thanks, Hans. The problem was that the paragraph I was in did not use a Unicode font, hence the unexpected results.

Posting Permissions

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