Exchange available - solution using CDO v1.21

  • Thread starter Thread starter gxdata
  • Start date Start date
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
 
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.
 
Back
Top