Offline mode in outlook XP

  • Thread starter Thread starter tphau
  • Start date Start date
T

tphau

Hi All,

How can I determine the Online/Offline mode in OL XP by VB code?

Any help would be appreciated,
tphau
 
Outlook 2002 and 2003 have a NameSpace.Offline Boolean property.

For Outlook 2000 and earlier you'd have to use CDO 1.21 code or something
else like Extended MAPI or Redemption to work with MAPI properties. There's
a CDO 1.21 code sample for that at www.cdolive.com/cdo5.htm.
 
Hi Ken Slovak,

Thanks for your reply soon. But the NameSpace.Offline Boolean property
was not updated while in objOfflineControl_Click event. Below is my
code to catch the Offline Click and then pop-up the OL mode as belows:

**********************************
Dim WithEvents objOfflineControl As Office.CommandBarButton
' get Offline menu
Set objOfflineControl = objExplorer.CommandBars.FindControl(ID:=5613)

.........

Private Sub objOfflineControl_Click(ByVal Ctrl As
Office.CommandBarButton, CancelDefault As Boolean)
On Error GoTo Error_Handler
If g_NameSpace.Offline Then
MsgBox "You are working Offline mode"
Else
MsgBox "You are working Online mode"
End If

Exit Sub
Error_Handler:
Call ErrorLogX("Connect: objOfflineControl_Click", 0, 0,
Err.Description)
Err.Clear
End Sub
**********************************
So the problem is showing up incorrect OL mode because it was set
after through
the function objOfflineControl_Click. Do you has any solution/way to
determine OL mode such as *after click*, please point to me.

Thanks in advance,
tphau
 
Back
Top