Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Pune
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find ANSI/Unicode value of a Character

    How do I get the Find ANSI/Unicode value of a Character in a file? Esp Math/ Greek characers, etc?

  2. #2
    BAM
    Guest

    Re: Find ANSI/Unicode value of a Character

    Hi Rajesh,

    Here is a little macro I use for this:

    Sub Whatsit()
    Dim ansinum As Long, unicodenum As Long
    ansinum = Asc(Selection.Text)
    unicodenum = AscW(Selection.Text)
    If unicodenum < 0 Then
    unicodenum = unicodenum + 65536
    End If
    MsgBox "Ansi: " & ansinum & _
    ", Unicode: " & unicodenum
    End Sub
    ~~~~~~~~~~
    Cheers!

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find ANSI/Unicode value of a Character

    Good. Thanks!!

    Now, for bonus points, what regular characters in Word would produce UniCodes? That is, how can we test the macro to make sure that it is working?

  4. #4
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Pune
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find ANSI/Unicode value of a Character

    Thanks for posting the macro. This Macro however gives some error message at this line:

    If unicodenum < 0 Then
    unicodenum = unicodenum + 65536

    Can you figure this out?

  5. #5
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Pune
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find ANSI/Unicode value of a Character

    Extremely sorry. Ignore the earlier post. I got an entity < for the less than sign, and copied it into the macro.

  6. #6
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Pune
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find ANSI/Unicode value of a Character

    Try em-dash

  7. #7
    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: Find ANSI/Unicode value of a Character

    Beware the Symbol font; it does not behave like the others. There are two other threads on that.

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find ANSI/Unicode value of a Character

    Thank you

Posting Permissions

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