Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / June 2004

Tip: Looking for answers? Try searching our database.

objInfoStore.Fields(CdoPR_STORE_OFFLINE).Value and Cached Mode

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael Kensy - 19 Jun 2004 13:48 GMT
Hi,

I did use a folder Homepage which works fine with OL.2k and OL.XP but
not (I migrated to...) OL.2k3. It doesn't work fine at that statement:

 IsOffline = objInfoStore.Fields(CdoPR_STORE_OFFLINE).Value

Problem is that the statement delivers 'true' if OL is connected to the
ExchangeServer but in Cached Mode ... disabling 'cached Mode' let it
work. So what property do I have to ask for in OL.2k3?

thanx in advance
Michael
Ken Slovak - [MVP - Outlook] - 21 Jun 2004 14:55 GMT
What you get when you query for cached mode depends also on your version of
Exchange server. NameSpace.ExchangeConnectionMode (only available with
Outlook 2003 of course) has an enum that can return various cached and
uncached settings such as olCachedConnectedDrizzle and so on but with
Exchange 5.5 you get olNoExchange in cached mode. You can look up the
olExchangeConnectionMode enum in the Object Browser.

If you are going to be supporting various versions of Exchange server you
need to check for Exchange, and then if you get olNoExchange for
ExchangeConnectionMode you know it's some variation of cached mode.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi,
>
[quoted text clipped - 9 lines]
> thanx in advance
> Michael
Michael Kensy - 30 Jun 2004 12:20 GMT
Hi Ken,

thanxs for your reply ...

> What you get when you query for cached mode depends also on your
> version of Exchange server. NameSpace.ExchangeConnectionMode (only
[quoted text clipped - 3 lines]
> You can look up the olExchangeConnectionMode enum in the Object
> Browser.

I tried as suggested and got my folderhomepage working again ...

> If you are going to be supporting various versions of Exchange server
> you need to check for Exchange, and then if you get olNoExchange for
> ExchangeConnectionMode you know it's some variation of cached mode.

do you know some tested code to do so? Sorry for asking but I don't use
exchange 5.5 anymore but would like to prepare myHomepage for.

thanx in every case
Michael
Ken Slovak - [MVP - Outlook] - 30 Jun 2004 14:38 GMT
The code I use requires CDO, which may not be available since it's an
optional installation for Outlook 2000 and later. First I get the Outlook
version (Application.Version) as a string and look at the 2 left characters
of the string. If the leftmost one is "9" it's Outlook 2000, if "10" it's
Outlook 2002 and if "11" it's Outlook 2003. Then I call the following
procedure.

' olConnectMode is a global defined as follows:
Public Enum OL2003ConnectionMode
 CacheConnectDrizzle = 600
 CacheConnectFull = 700
 CacheConnectHeaders = 500
 CacheDisconnect = 400
 CacheOffline = 200
 Disconnect = 300
 NoExchange = 0
 Offline = 100
 Online = 800
End Enum

Public olConnectMode As OL2003ConnectionMode

Private Function UserOnline() As Boolean
 On Error Resume Next

 Const PR_STORE_OFFLINE = &H6632000B
 Const CdoPR_PROVIDER_DISPLAY = &H3006001E

 UserOnline = False
 olConnectMode = Online

 With g_objDefaultInfoStore 'gotten by using Inbox.StoreID and
Session.GetInfoStore
   If g_lngVersion >= 10 Then 'g_lngVersion set as Outlook version as a
Long
     UserOnline = Not (g_objApp.Session.Offline) 'not available for Outlook
2000
     If g_lngVersion = 10 Then
       If Not UserOnline Then
         olConnectMode = Offline
       End If
     ElseIf g_lngVersion = 11 Then
       olConnectMode = g_objApp.Session.ExchangeConnectionMode

       If InStr(1, .Fields(CdoPR_PROVIDER_DISPLAY), _
         "Microsoft Exchange", vbTextCompare) > 0 Then

         If ((UserOnline) And (olConnectMode = NoExchange)) Then
           olConnectMode = Offline
         End If
       End If
     End If
   Else
     If InStr(1, .Fields(CdoPR_PROVIDER_DISPLAY), "Microsoft Exchange", _
       vbTextCompare) > 0 Then

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

     ElseIf InStr(1, .Fields(CdoPR_PROVIDER_DISPLAY), "Personal Folders", _
       vbTextCompare) > 0 Then

       UserOnline = True
     End If

     If Not UserOnline Then
       olConnectMode = Offline
     End If
   End If
 End With

 If Err <> 0 Then
   LogAddInErr Err, "clsAddin", "UserOnline", "Error!"
   'Err.Clear
 End If
End Function

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Hi Ken,
>
[quoted text clipped - 19 lines]
> thanx in every case
> Michael
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.