dev
15 years ago
I'm trying to use (extended) MAPI to read the contents of a shared
calendar.
Using the Outlook objects, it's easy :
_NameSpace olNs( olApp.GetNamespace("MAPI") );
...
Recipient olRecipient =
olNs.CreateRecipient( (LPCTSTR)szSharedCalendarName );
if ( olRecipient.Resolve() )
{
MAPIFolder olFolder = olNs.GetSharedDefaultFolder(olRecipient,
olFolderCalendar);
_Items olItems = olFolder.GetItems();
but I can't find any information on doing the same thing in Extended
MAPI.
I can get my own calendar no problem :
LPMAPIFOLDER lpInbox = NULL;
hr = m_pMessageStore->GetReceiveFolder(NULL, 0, &cbEntryID,
&lpEntryID, NULL );
if (FAILED(hr)) return hr;
hr = m_pMessageStore->OpenEntry( cbEntryID, lpEntryID, NULL,
MAPI_MODIFY,
&ulObjType, (LPUNKNOWN FAR
*)&lpInbox );
if (FAILED(hr)) return hr;
hr = HrGetOneProp( (LPMAPIPROP)lpInbox, PR_IPM_APPOINTMENT_ENTRYID,
&pPropValue );
if (FAILED(hr)) return hr;
hr = m_pMessageStore->OpenEntry( pPropValue->Value.bin.cb,
(ENTRYID*)pPropValue->Value.bin.lpb,
NULL, MAPI_MODIFY, &ulObjType,
(IUnknown**)&lpFolder );
if (ulObjType != MAPI_FOLDER) // must be a folder
return E_FAIL;
// read the contents of the folder
etc.
But how do I access a shared calendar ?
(I can't seem to find any examples on the web, which surprises me)
Regards,
Tim Dale, BRE
***@cav_en_dish.c_o.u_k
(remove all underscores to email directly)
calendar.
Using the Outlook objects, it's easy :
_NameSpace olNs( olApp.GetNamespace("MAPI") );
...
Recipient olRecipient =
olNs.CreateRecipient( (LPCTSTR)szSharedCalendarName );
if ( olRecipient.Resolve() )
{
MAPIFolder olFolder = olNs.GetSharedDefaultFolder(olRecipient,
olFolderCalendar);
_Items olItems = olFolder.GetItems();
but I can't find any information on doing the same thing in Extended
MAPI.
I can get my own calendar no problem :
LPMAPIFOLDER lpInbox = NULL;
hr = m_pMessageStore->GetReceiveFolder(NULL, 0, &cbEntryID,
&lpEntryID, NULL );
if (FAILED(hr)) return hr;
hr = m_pMessageStore->OpenEntry( cbEntryID, lpEntryID, NULL,
MAPI_MODIFY,
&ulObjType, (LPUNKNOWN FAR
*)&lpInbox );
if (FAILED(hr)) return hr;
hr = HrGetOneProp( (LPMAPIPROP)lpInbox, PR_IPM_APPOINTMENT_ENTRYID,
&pPropValue );
if (FAILED(hr)) return hr;
hr = m_pMessageStore->OpenEntry( pPropValue->Value.bin.cb,
(ENTRYID*)pPropValue->Value.bin.lpb,
NULL, MAPI_MODIFY, &ulObjType,
(IUnknown**)&lpFolder );
if (ulObjType != MAPI_FOLDER) // must be a folder
return E_FAIL;
// read the contents of the folder
etc.
But how do I access a shared calendar ?
(I can't seem to find any examples on the web, which surprises me)
Regards,
Tim Dale, BRE
***@cav_en_dish.c_o.u_k
(remove all underscores to email directly)