PR_STORE_OFFLINE from Redemption

  • Thread starter Thread starter Balch
  • Start date Start date
B

Balch

Hello,

I am trying to determine if Outlook is currently in Offline mode.
Looking at OutlookSpy it appears there is an PR_STORE_OFFLINE property
of the IMsgStore object that contains this information.

Can I access this info from the Redemption lib? If not, is there any
other way to determine if Outlook is in Offline mode.

Thanx in advance,

Jay Balch
 
PR_STORE_OFFLINE can be accessed using Redemption, just as any other
field can be accessed. However you don't say which version of Outlook
you are using. That MAPI property is valid for Outlook 2000 and
earlier, for Outlook 2002 and later it's broken. For those versions
you would use Outlook.Session.Offline (a Boolean).

I test for Outlook.Version and depending on the version string
returned I branch in a Select Case block to see how I am going to
check for offline status.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
At the present time Redemption doesn't provide InfoStores. Dmitry says
he's going to add them in version 3.4 which he's starting development
on.

I use CDO for that, I get the default InfoStore as a global in my code
as well as the Outlook version as a long (9 for Outlook 2000, 10 for
2002 and 11 for 2003) and use code like the following (this is from a
COM addin so I also have a global referencing the Application object
passed to the COM addin in the On_Connection event):

Private Function UserOnline() As Boolean
Dim objOL As Object

On Error Resume Next

UserOnline = False

If g_lngVersion >= 10 Then
Set objOL = g_objOL
UserOnline = Not (objOL.Session.Offline)
Else
If InStr(1, g_objInfoStore.Fields(CdoPR_PROVIDER_DISPLAY), _
"Microsoft Exchange", vbTextCompare) > 0 Then

'Check if store is in offline mode
UserOnline = Not (g_objInfoStore.Fields(PR_STORE_OFFLINE).Value)
End If
End If

Set objOL = Nothing
End Function

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
Back
Top