IPOutlookItemCollection::Item
The Item method retrieves an item from a folder, based on the current sort order.
Syntax
HRESULT Item(
int iItem,
IDispatch ** ppolItem
);
Parameters
- iItem
[in] The one-based index for the item to retrieve. The index is the position of the item in the current sort order. - ppolItem
[out] Reference to the retrieved item.
Return Values
This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:
- S_OK
The method completed successfully.
Remarks
None.
Example
The following code example shows how to retrieve an item from an Items collection.
void GetAnItem(IPOutlookApp * polApp)
{
IPOutlookItemCollection * pItems;
ITask * pTask;
// Get the fifth item in the tasks folder.
polApp->GetDefaultFolder(olFolderTasks, &pFolder)
pFolder->get_Items(&pItems);
pItems->Item(5,(IDispatch **)&pTask);
// Do something with the task here...
// ...
// Release objects
pItems->Release();
pTask->Release();
}
Requirements
Smartphone: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later
Header: pimstore.h
Library: pimstore.lib
See Also
How to: Retrieve a PIM Item from the Pocket Outlook Database
Pocket Outlook Object Model API Interfaces
Last updated on Friday, April 22, 2005
© 2005 Microsoft Corporation. All rights reserved.
Send feedback on this topic to the authors.