none
continue to ask: I use MAPI to retrieve Outlook Contact's comment, but if the content in comment to long, will return MAPI_E_NOT_ENOUGH_MEMORY error

    General discussion

  • I could not reply in the old question, so I open one discussion.

    I have already use the following code:

    char *bodybuf=0;
        unsigned int bodysize=0;
        IStream *istream;

    //I also have tried PR_HTML

       hr = imsg->OpenProperty(PR_BODY_HTML, &IID_IStream, 0, 0, (IUnknown**)&istream);
        if (hr==S_OK)
        {
            STATSTG stg = {0};
            hr = istream->Stat(&stg,STATFLAG_NONAME);
            if (hr==S_OK)
            {
                bodysize = stg.cbSize.HighPart;
                bodybuf = new char[bodysize+1];
                ULONG red;
                hr = istream->Read(bodybuf, bodysize, &red);
                if (hr!=S_OK)
                    bodysize=0;
                else if (red<bodysize)
                    bodysize=red;
                bodybuf[bodysize]=0;
            }
            istream->Release();
        }


    but the bodysize is also 0, also the notes of contact is not empty.

    Could the pr_html indicates the notes attribute of contact in MAPI?

    Thank you very much.

    Tuesday, January 15, 2013 3:59 AM

All replies

  • Contacts and appointments in Outlook do not use HTML, only RTF - you are limited in PR_BODY and PR_RTF_COMPRESSED.

    Look at a contact with MFCMAPI or OutlookSpy (click IMessage).


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.4 is now available!

    Tuesday, January 15, 2013 5:19 AM