Exchange available - solution using CDO v1.21

G

gxdata

VB.NET, requires reference to CDO v1.21 (MAPI)

Private Function ExchangePresent() As Boolean
Dim sc As MAPI.SessionClass = New MAPI.SessionClass()
' This is a crude logon - I don't do it this way
sc.Logon(Type.Missing, Type.Missing, Type.Missing, Type.Missing, _
Type.Missing, Type.Missing, Type.Missing)
Dim isrs As MAPI.InfoStores = TryCast(sc.InfoStores, MAPI.InfoStores)
Dim index As Integer=1
Do While index <= CInt(Fix(isrs.Count))
If (CType(isrs.Item(index), _
MAPI.InfoStore)).ProviderName.ToString().ToUpper().IndexOf("EXCHANGE")
Return True
End If
index += 1
Loop
Return False
End Function
 
K

Ken Slovak - [MVP - Outlook]

CDO 1.21 is not supported with .NET. While it may work most of the time on
most machines you will run into problems no one will support you with in
use.
 
Top