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.
Code Example
The following code example shows how to retrieve an item from an Items collection.
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.
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
Pocket PC: Pocket PC 2000 and later
Smartphone: Smartphone 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 Outlook Mobile Database | IPOutlookItemCollection | Pocket Outlook Object Model API Interfaces
Send Feedback on this topic to the authors