Re: How to find the incoming mail's language charset using MAPI on



Because Outlook 2000 does not natively support Unicode. Once again, the body
must be converted from PR_RTF_COMPRESSED.
For the subject, if the STORE_UNICODE_OK bit is missing from the
PR_STORE_SUPPORT_MASK property (meaning there is no native Unicode support),
read PR_SUBJECT_A and call MultibyteToWideChar using the value of the
PR_INTERNET_CPID property as a code page.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Dkds.Naidu" <dkdsnaidu819@xxxxxxxxxxx> wrote in message
news:E47E1A38-F2E4-45B5-B4E2-4D5906B04B27@xxxxxxxxxxxxxxxx
> PR_BODY_W and PR_SUBJECT_W are not working for Outlook 2000. These two are
> failed.why?
>
> Any other proerties are there are for getting unicode data of a mail?
>
> How to solve this problem?
>
> Thanks in advance.
>
>
> --
> DKDS.Naidu,
> Programmer Analyst,
> ITPL - Bangalore.
>
>
> "Dmitry Streblechenko" wrote:
>
>> If the store supports Unicode natively, read the Unicode version of
>> PR_BODY
>> (PR_BODY_W). Otherwise you would need to convert the RTF body (either
>> pure
>> RTF or RTF wrapped HTML) to plain text. Creating a hidden RTF control,
>> streaming the RTF data in and then streaming plain text out will do the
>> trick.
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Dkds.Naidu" <dkdsnaidu819@xxxxxxxxxxx> wrote in message
>> news:E02EC3D4-0578-45B8-AC42-F83116127242@xxxxxxxxxxxxxxxx
>> >
>> > How to get the body(non-english characters) of incoming mail if it has
>> > unicode characters?
>> >
>> > Plz explain with a small code snippet if possible.
>> >
>> > Thanks in advance.
>> > --
>> > DKDS.Naidu,
>> > Programmer Analyst.
>> >
>> >
>> >
>> > "Dkds.Naidu" wrote:
>> >
>> >> Hi Dmitry Streblechenko,
>> >>
>> >> When I added "PR_INTERNET_CPID" to properties list, immediately I
>> >> am
>> >> getting this error. How can I resolve this error?
>> >> error C2065: 'PR_INTERNET_CPID' : undeclared identifier
>> >>
>> >>
>> >> I tried with this below code. But I can't get the internet code page
>> >> id.
>> >> How?
>> >>
>> >> #ifndef PR_INTERNET_CPID
>> >> #define PR_INTERNET_CPID (PROP_TAG(PT_LONG,0x3FDE0003))
>> >> #endif
>> >>
>> >> HRESULT hRes = HrGetOneProp(lpMessage, PR_INTERNET_CPID, &lpPropCPID);
>> >> if (SUCCEEDED(hRes))
>> >> {
>> >> MessageBox(NULL,"Succ...","Internet Code Page",MB_OK);
>> >> }
>> >> else
>> >> {
>> >> MessageBox(NULL,"Fail...","Internet Code Page",MB_OK);
>> >> }
>> >>
>> >> With this code snippet, I am getting always fail only. How can I sove?
>> >>
>> >> Thanks in advance.
>> >>
>> >> Best regards,
>> >>
>> >> --
>> >> DKDS.Naidu,
>> >> Programmer Analyst,
>> >> ITPL - Bangalore.
>> >>
>> >>
>> >> "Dmitry Streblechenko" wrote:
>> >>
>> >> > I am not sure what you mean: you need to read it the same way you
>> >> > read
>> >> > other
>> >> > properties in your code (e.g. PR_SUBJECT).
>> >> > PR_INTERNET_CPID will give you an integer identifier of the code
>> >> > page.
>> >> >
>> >> > Dmitry Streblechenko (MVP)
>> >> > http://www.dimastr.com/
>> >> > OutlookSpy - Outlook, CDO
>> >> > and MAPI Developer Tool
>> >> >
>> >> > "Dkds.Naidu" <dkdsnaidu819@xxxxxxxxxxx> wrote in message
>> >> > news:D6232FC1-DD83-44A0-B5AB-4C05C2229DD3@xxxxxxxxxxxxxxxx
>> >> > > Thank you very much for your immediate reply.
>> >> > >
>> >> > > Can you give a rough code snippet with PR_INTERNET_CPID?
>> >> > > I searched in google and MSDN. But I didnt get any help.
>> >> > >
>> >> > > Once again thank you for your reply.
>> >> > >
>> >> > > Best regards,
>> >> > > --
>> >> > > DKDS.Naidu,
>> >> > > Programmer Analyst,
>> >> > > ITPL - Bangalore.
>> >> > >
>> >> > >
>> >> > > "Dmitry Streblechenko" wrote:
>> >> > >
>> >> > >> Read the PR_INTERNET_CPID property.
>> >> > >>
>> >> > >> Dmitry Streblechenko (MVP)
>> >> > >> http://www.dimastr.com/
>> >> > >> OutlookSpy - Outlook, CDO
>> >> > >> and MAPI Developer Tool
>> >> > >>
>> >> > >> "Dkds.Naidu" <dkdsnaidu819@xxxxxxxxxxx> wrote in message
>> >> > >> news:3000C67A-1724-4A12-957D-A084A763A2BC@xxxxxxxxxxxxxxxx
>> >> > >> > Hi,
>> >> > >> >
>> >> > >> > I am devloping ATL COM Addin using Visual C++.I tried to trap
>> >> > >> > incoming
>> >> > >> > message using IExchExtSessionEvents::OnDelivery overidden
>> >> > >> > method.
>> >> > >> > I can get the subject,entryid and body(ASCII) of incoming mail.
>> >> > >> > How can
>> >> > >> > I
>> >> > >> > get the language (english,chinese or korea) of incoming mail?
>> >> > >> >
>> >> > >> > I am giving rough code. plz correct me.
>> >> > >> >
>> >> > >> > STDMETHODIMP
>> >> > >> > CExchangeAddin::OnDelivery(IExchExtCallback*lpExchangeCallback)
>> >> > >> > {
>> >> > >> > LPMESSAGE lpMessage = NULL;
>> >> > >> > LPMDB lpMdb = NULL;
>> >> > >> > ULONG ulPropCount = 0;
>> >> > >> > LPSPropValue lpMessageProps = NULL;
>> >> > >> > if (SUCCEEDED(lpExchangeCallback->GetObject(&lpMdb,
>> >> > >> > (LPMAPIPROP*)&lpMessage)))
>> >> > >> > {
>> >> > >> > static SizedSPropTagArray(6,PropTagArray) =
>> >> > >> > {
>> >> > >> > 6,
>> >> > >> > {
>> >> > >> > PR_SUBJECT, // Subject of incoming Mail
>> >> > >> > PR_BODY, // Body of incoming Mail
>> >> > >> > PR_ENTRYID, // Entry ID of incoming mail
>> >> > >> > PR_PARENT_ENTRYID, // Folder ID of incoming Mail
>> >> > >> > PR_SENDER_EMAIL_ADDRESS, // SendersMailID
>> >> > >> > PR_BODY_HTML // Hypertext Markup Language
>> >> > >> > version of
>> >> > >> > the message text
>> >> > >> > }
>> >> > >> > };
>> >> > >> > HRESULT hr = lpMessage->OpenProperty(PR_BODY_HTML,
>> >> > >> > &IID_IStream,
>> >> > >> > STGM_READ, 0, (IUnknown**)&pStreamHTMLBody);
>> >> > >> > if (hr==S_OK)
>> >> > >> > {
>> >> > >> > if
>> >> > >> > (SUCCEEDED(lpMessage->GetProps((LPSPropTagArray)&PropTagArray,0,&ulPropCount,&lpMessageProps)))
>> >> > >> > {
>> >> > >> > MessageBox(NULL,lpMessageProps[1].Value.lpszA,"",MB_OK);//I can
>> >> > >> > get the
>> >> > >> > body of incoming mail.
>> >> > >> > //How can I get this is ascii or non-ascii mail?
>> >> > >> > //Which property should I use?
>> >> > >> > //How to use PR_LANGUAGE or PR_LANGUAGES?
>> >> > >> > }//end of getprops
>> >> > >> >
>> >> > >> > }//end of openproperty
>> >> > >> >
>> >> > >> > }//end of getobject
>> >> > >> > }
>> >> > >> >
>> >> > >> > Thanks in advance.
>> >> > >> >
>> >> > >> > Best regards,
>> >> > >> > Dkds.naidu.
>> >> > >> >
>> >> > >> > --
>> >> > >> > DKDS.Naidu,
>> >> > >> > Programmer Analyst,
>> >> > >> > ITPL - Bangalore.
>> >> > >>
>> >> > >>
>> >> > >>
>> >> >
>> >> >
>> >> >
>>
>>
>>


.



Relevant Pages

  • Re: Mails öffnen < 2003 ?
    ... Wenn man im Outlook 2003 eine Mail via Drag n Drop auf ein Laufwerk ... Wenn man die Mail via Speichern unter als MSG speichert ohne Unicode, ...
    (microsoft.public.de.outlook)
  • Re: Datentyp "text" zu klein! Wie das denn?
    ... dass Outlook ab version 2003 UNICODE unterstützt! ... Wenn Du damit Unicode PST Dateien meinst: ... >> ich die Daten komprimieren. ... >> wie RTF) gilt das auch. ...
    (microsoft.public.de.sqlserver)
  • Re: Outlook 2003 IMAP UNICODE
    ... > let you know that IMAP and HTTP do not support Unicode ... > Outlook can run in one of two mailbox modes on Microsoft Exchange Server: ... > POP3 accounts also have the capability to support multilingual Unicode ... > Folders file that can support multilingual Unicode data. ...
    (microsoft.public.outlook.general)
  • Re: Max PST size?
    ... Outlook.pst from ANSI to Unicode ... I prefere to use Outlook 2003 with Unicode PST ... | of the larger PST file support Unicode offers? ...
    (microsoft.public.outlook)
  • Re: unicode? non-unicode? Is Outlook 2003 obsolete software?
    ... Is it true that from Outlook 2003 the PST should have the Unicode by default? ... I thought my store is in unicode but it rather appears it is not. ... But French characters like è are not kept in user defined fields. ...
    (microsoft.public.outlook.program_vba)