Export (0) Print
Expand All

OlItemType

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

The OlItemType enumeration identifies the PIM item type.


(in PimStore.h)
enum OlItemType {
  olAppointmentItem = 1,
  olContactItem     = 2,
  olTaskItem        = 3,
  olCityItem        = 102
};

olAppointmentItem

An appointment item.

olContactItem

A contact item.

olTaskItem

A task item.

olCityItem

A city item.

Description

The following code example demonstrates how to use OlItemType to create a SIM Contact item.

Aa911356.note(en-us,MSDN.10).gifNote:
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.

Code

hr = ExCreateContactByType(polApp, olSimContactItem, "John Doe", "4255551212");

HRESULT ExCreateContactByType(__in IPOutlookApp *polApp, int olItemType, __in BSTR szName, __in BSTR szHomePhone)

{
    HRESULT            hr = S_OK;
    IDispatch * pDispatch = NULL;
    IContact   * pContact = NULL;

    hr = polApp->CreateItem(olItemType, &pDispatch);
    hr = pDispatch->QueryInterface(IID_IContact, (void **)&pContact);
    hr = pContact->put_FirstName(szName);
    hr = pContact->put_BusinessTelephoneNumber(szHomePhone);
    hr = pContact->Save();

    RELEASE(pContact);
    RELEASE(pDispatch);

    return hr;
}

Headerpimstore.h
LibraryPimstore.lib
Windows Embedded CEWindows CE 3.0 and later
Windows MobilePocket PC 2000 and later, Smartphone 2002 and later

Community Additions

ADD
Show:
© 2014 Microsoft