Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
A version of this page is also available for
4/8/2010
The Removemethod removes an item from the item collection, based on the current sort order.
Syntax
HRESULT Remove( int iItem ); |
Parameters
- iItem
-
[in] The one-based index for the item to remove. The index is the position of the item in the current sort order.
Return Value
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
You can remove only user-defined items. Items in ROM cannot be removed.
Code Example
The following code example shows how to remove 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. |
Copy Code | |
---|---|
void RemoveAnItem(IPOutlookApp * polApp) { IPOutlookItemCollection * pItems; IFolder * pFolder; ITask * pTask; // Remove the fifth item in the tasks Items collection. polApp->GetDefaultFolder(olFolderTasks, &pFolder); pFolder->get_Items(&pItems); pItems->Remove(5) // Release objects. pItems->Release(); pFolder->Release(); pTask->Release(); } |
Requirements
Header | pimstore.h |
Library | Pimstore.lib |
Windows Embedded CE | Windows CE 2.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |