Unicode Characters

M

mookashi

Hi,
Earlier once i had posted a query asking how to check if the messag
body is unicode or normal text.

Ken had suggested the following solution:

One way would be to check MailItem.InternetCodePage. Another would be
to get Item.Body and see if the text is Unicode by checking for 0x00
after every character.

well im using Outlook 2000 and Developing Com AddIn using VB6
i didnt find anything like MailItem.InternetCodePage

secondly if im to use the other method suggested above , how do
exactly do it. can you provide me a code snippet of that. i cant figur
out how to check the 0x00 in the message body!!

Thanks in advance
 
K

Ken Slovak - [MVP - Outlook]

MailItem.InternetCodePage is only there for Outlook 2002 and later.

This would check for at least one 0x00 in a text string:
If InStr(1, strBody, Chr(0)) > 0 Then

That test would only be valid for non-Unicode languages and for
Unicode languages that have their high byte character set to 0x00.
Some Unicode languages may use other high bytes which would invalidate
that test.

Another method, which would work with Outlook 2000 and later would be
to get the MAPI property PR_MESSAGE_CODEPAGE (0x3FFD0003) as a field
on the mail item using CDO 1.21 or Extended MAPI or Redemption, which
let you get at the Fields collection of the item.
 

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