Retrieving a PIM Item from the Outlook Mobile Database (Windows Embedded CE 6.0)
1/6/2010
Retrieving a PIM item from the Outlook Mobile database involves calling the IPOutlookItemCollection::Item method on the collection.
The Outlook Mobile database consists of three separate PIM item lists contained in the three Default Folders: the Appointments folder, the Tasks folder, and the Contacts folder.
Create an instance of the Outlook Mobile application object and then use it to establish a POOM session. For more information, see Establishing a POOM Session.
Declare a reference to a generic PIM item collection:
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)
The following code example demonstrates how to retrieve the third Task item from the Tasks Folder.
Note
To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.
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)
// ...
// Do something with the Task item...
// ...
}
To make the code example easier to read, security checking and error handling are not included.
This code example should not be used in a release configuration unless it has been modified to include them.
- Include Header File: PimStore.h
- Linker Dependency: PimStore.lib
Pocket Outlook Object Model Common Tasks
Pocket Outlook Object Model Application Development