IContact::Save (Windows CE 5.0)
This method saves a Contact item.
HRESULT Save ();
Return Values
S_OK indicates that the Contact item was saved successfully. If the Contact cannot be saved, the appropriate HRESULT is returned.
Remarks
In order to save a contact, you must specify at least one of the following four properties: FirstName, LastName, CompanyName, and FileAs.
Example
The following code example creates and saves a new Contact.
void SaveContact(IPOutlookApp *polApp)
{
IContact *pContact;
IFolder *pFolder;
IPOutlookItemCollection *pItems;
// Create a new contact.
polApp->GetDefaultFolder (olFolderContacts, &pFolder);
pFolder->get_Items (&pItems)
pItems->Add (&pContact)
pContact->put_FirstName (TEXT ("Brian"));
pContact->put_LastName (TEXT ("Fleming"));
pContact->put_Company (TEXT ("Microsoft"));
pContact->put_FileAs (TEXT ("Fleming"));
// Save the new contact.
pContact->Save ();
// Release objects
pContact->Release ();
pFolder->Release ();
pItems->Release ();
}
Requirements
OS Versions: Windows CE 2.0 and later.
Header: Pimstore.h.
Link Library: Pimstore.lib.
See Also
IContact | IContact Properties
Send Feedback on this topic to the authors