How to: Retrieve a PIM Item from the Pocket Outlook Database
Retrieving a PIM item from the Pocket Outlook database involves calling the IPOutlookItemCollection::Item method on the collection.
The Pocket Outlook database consists of three separate PIM item lists contained in the three default folders: the Appointments folder, the Tasks folder, and the Contacts folder.
To retrieve a particular item from the Tasks folder
Create an instance of the Pocket Outlook application object and then use it to establish a POOM session. For more information, see How to: Establish a POOM Session.
Declare a reference to a generic PIM item collection, as follows:
IPOutlookItemCollection *pItems;
Declare a reference to a generic PIM item folder:
IFolder *pFolder;
Declare a reference to a Task item:
ITask *pTask;
Use the generic PIM item folder to get the Tasks folder:
polApp->GetDefaultFolder(olFolderTasks, &pFolder);
Use the Tasks folder to get the collection of Task items:
pFolder->get_Items(&pItems)
Get the third Task item from the collection of Task items:
pItems->Item(3, &pTask)
Example
The following code demonstrates how to retrieve the third Task item from the Tasks folder.
int index = 3;
void RetrieveTask(IPOutlookApp *polApp, int index)
{
IPOutlookItemCollection *pItems;
IFolder *pFolder;
ITask *pTask;
polApp->GetDefaultFolder(olFolderTasks, &pFolder)
pFolder->get_Items(&pItems);
pItems->Item(index, &pTask)
}
See Also
Last updated on Friday, April 22, 2005
© 2005 Microsoft Corporation. All rights reserved.
Send feedback on this topic to the authors.