IPOutlookApp::GetDefaultFolder

Send Feedback

The GetDefaultFolder method gets an IFolder object for one of the five folders provided by Outlook Mobile.

Syntax

HRESULT GetDefaultFolder(
  int olFolder,
  IFolder ** ppIFolder
);

Parameters

  • olFolder
    [in] Specifies which of the following OlDefaultFolders enumeration value to get: olFolderCalendar, olFolderTasks, olFolderContacts, or olFolderInfrared.
  • ppIFolder
    [out] Reference to a folder object.

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.

Code Example

The following code example shows how to get the Outlook Mobile Contacts folder.

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 GetContactsFolder(IPOutlookApp * polApp)
{
    IFolder * pFolder;
    polApp->GetDefaultFolder(olFolderContacts, &pFolder);
    ...

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: Add PIM Items to the Outlook Mobile Database | IPOutlookApp | Pocket Outlook Object Model API Interfaces | Pocket Outlook Object Model API Enumerations

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.