IPOutlookItemCollection::Add
The Add method creates a new item for a folder in the Items collection. The item type depends on the folder type.
Syntax
HRESULT Add(
IDispatch ** ppolItem
);
Parameters
- ppolItem
[out] Reference to the new 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
This method creates an item in memory. You must still save the item to the collection.
Example
The following code example shows how to add an item to an Items collection.
void CreateTask(IPOutlookApp * polApp)
{
IPOutlookItemCollection * pItems;
ITask * pTask;
pFolder->get_Items(&pItems);
pItems->Add((IDispatch**)&pTask)
// Commit the item to the store.
pTask->Save();
// 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: Add PIM Items to 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.