Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

how to return the character code of the current character?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Abeness - 23 Mar 2005 01:55 GMT
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
Jean-Guy Marcil - 23 Mar 2005 04:34 GMT
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)

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Abeness - 23 Mar 2005 16:18 GMT
>     MyCharCode = AscW(Selection.Text)

Exactly what I needed. Thanks a lot, Jean-Guy.

Abe
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.