共用方式為


About the Offline State API

Applies to: Office 2010 | Outlook 2010 | Visual Studio

The Offline State API supports callbacks indicating changes in a user's connection state in Microsoft Outlook 2010—for example, from being online in Outlook 2010 to being offline. The API uses a global offline object in Outlook 2010 to track such changes for a given user account profile. Notification is the only supported form of callback. As clients of this API, mail providers who want to be notified of such connection state changes do the following:

  1. Implement IMAPIOfflineNotify.

  2. Open an existing offline object for a specific profile using HrOpenOfflineObj.

  3. Determine if the object has the capability of providing online or offline notifications using IMAPIOffline::GetCapabilities.

  4. Register the object for online or offline notifications using IMAPIOfflineMgr::Advise. Mail providers can now receive notifications that Outlook 2010 sends using IMAPIOfflineNotify.

  5. On shutdown, remove registration for online and offline notifications using IMAPIOfflineMgr::Unadvise.

Note

In general, Outlook 2010 can notify a client of online/offline changes as well as other changes, but the Offline State API supports only notifications for online/offline changes. The client should ignore all other notifications. For more information, see IMAPIOfflineNotify::Notify and MAPIOFFLINE_NOTIFY.

For an example of a client that uses the Offline State API, see About the Sample Offline State Add-in. The Sample Offline State Add-in is a COM add-in that uses the Offline State API to monitor and change the connection state.

This API provides the following:

Definitions:

Data types:

Functions:

Interfaces: