HOWTO: Determine If a CDO Session Is Online or Offline from VBLast reviewed: February 16, 1998Article ID: Q181035 |
The information in this article applies to:
SUMMARYWhen an application logs on to Exchange Server using a profile that includes an offline store (OST), it may be necessary to determine the online/offline status of the store programmatically. This information is found in a MAPI property (PR_STORE_OFFLINE) that is set on the Message Store object. The PR_STORE_OFFLINE property is a Boolean property that is True if the store is offline and False if the store is online. From CDO, the PR_STORE_OFFLINE property is exposed as a member of the Fields collection of an InfoStore object.
MORE INFORMATIONHere is a Visual Basic code sample demonstrating how to access the PR_STORE_OFFLINE property of an InfoStore object using the CDO Library. This code assumes a valid reference to the Microsoft Active Messaging 1.1 Object Model (now named Collaboration Data Objects) or later.
Private Sub Command1_Click() Dim objSession As MAPI.Session Dim objInfoStore As InfoStore Set objSession = CreateObject("mapi.session") objSession.Logon Set objInfoStore = objSession.InfoStores("Public Folders") If objInfoStore.Fields(&H6632000B).Value Then 'PR_STORE_OFFLINE MsgBox "Store is offline", , "Offline Status" Else MsgBox "Store is online", , "Offline Status" End If End Sub |
Additional query words: ActMsg OleMsg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |