Extracting Unicode MAPI properties using CDO

B

Bertin Colpron

I am designing a custom mail form and I need to extract some of the
sender MAPI properties using vbscript and CDO. For instance:

Dim cdoSession 'As MAPI.Session
Dim cdoAddrEntry 'As AddressEntry

Set cdoSession = CreateObject("Mapi.session")
cdoSession.Logon ,,false,false,0 'Use the existing Outlook
session.
Set cdoAddrEntry = cdoSession.CurrentUser

MsgBox "SenderLastName: " & cdoAddrEntry.fields(&h3a11001F)

The code above works fine for ANSI strings. Unicode strings, on the
other hand, are apparently converted to ANSI. Some (or all) characters
are converted to the question mark character ('?').

For example the string "ΚαλημέÏα κόσμε" becomes "?a??µ??a
??sµe".

Interestingly, retrieving such Unicode strings from a custom property
or from a control works fine.

I am using Outlook 2003 SP1 on WinXP SP connected to a Exchange 2003
server.

Regards,

Bertin Colpron
 

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