get_MAPIOBJECT for NoteItem

R

Rustem

Hi All,

I have run into a problem that I don't know how to resolve. So any
help would be much appreciated!

I am trying to get a body of an Outlook NoteItem using MAPI object to
overcome security pop-up issue in Outlook 2003. Here is the code:

void ProcessNoteItem(Outlook::_NoteItem *pNoteItem, CString *pcsBody)
{
HRESULT hr;
IUnknown* pUnknown = NULL;
IMessage* pMessage = NULL;

if (pNoteItem)
{
hr = pNoteItem->get_MAPIOBJECT(&pUnknown);
if(SUCCEEDED(hr))
{
hr = pUnknown->QueryInterface(IID_IMessage, (void**) &pMessage);
if(SUCCEEDED(hr))
{
if(pMessage)
{
GetProp(pMessage, PR_BODY, pcsBody);

// release the message
pMessage->Release();
pMessage = NULL;
}
}
pUnknown->Release();
}
}
}

But the compiler complains: error C2039: 'get_MAPIOBJECT' : is not a
member of '_NoteItem' msoutl.tlh(3652) : see declaration of
'_NoteItem'

It works fine for all other types -'_MailItem', '_TaskItem',
'_ContactItem', '_appointmentItem', etc.

I am also using OutlookSpy, which suggests that get_MAPIOBJECT method
is defined, but may be hidden. If anybody knows how to resolve the
problem or might have any suggestions, please do reply to this
posting.

Thanks,
Rustem.
 

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