how to return the character code of the current character?

A

Abeness

I need a means of returning the Unicode character code of the character
adjacent to the cursor, to a variable. In Corel Ventura it's as simple as

..TextSpecialItemType lCharCode

(well, that returns a Long, lCharCode)

I've poked around the VBA Word Object Browser but haven't been able to
pinpoint the property or method I'd use to extract this info. Could
someone please enlighten me? Using Word 2003 and potentially also 2002.

Thanks,

Abe
 
J

Jean-Guy Marcil

Abeness was telling us:
Abeness nous racontait que :
I need a means of returning the Unicode character code of the
character adjacent to the cursor, to a variable. In Corel Ventura
it's as simple as
.TextSpecialItemType lCharCode

(well, that returns a Long, lCharCode)
It is just as simple in VBA!


Dim MyCharCode As Long

MyCharCode = AscW(Selection.Text)

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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