A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Exchange available - solution using CDO v1.21



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 8th 06, 06:14 AM posted to microsoft.public.outlook.program_vba
gxdata
external usenet poster
 
Posts: 13
Default Exchange available - solution using CDO v1.21

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")
= 0 Then

Return True
End If
index += 1
Loop
Return False
End Function

--
IL Thomas



Ads
  #2  
Old August 8th 06, 02:03 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Exchange available - solution using CDO v1.21

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.

--
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


"gxdata" wrote in message
...
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")
= 0 Then

Return True
End If
index += 1
Loop
Return False
End Function

--
IL Thomas




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What will be the best solution? wyca Outlook - Using Contacts 1 July 27th 06 01:09 PM
CDO and VB scripting install ngan Outlook - Installation 1 July 13th 06 02:43 PM
CDO and SMTP Servers [email protected] Outlook and VBA 3 June 15th 06 09:55 PM
mapi cdo service [email protected] Outlook - General Queries 8 February 20th 06 02:33 PM
Do i need Exchange for CDO A. Peters Outlook and VBA 4 February 17th 06 11:52 PM


All times are GMT +1. The time now is 02:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.