PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins How to detect Exchange?

Reply

How to detect Exchange?

 
Thread Tools Rate Thread
Old 04-07-2003, 12:13 PM   #1
Martynas Kunigelis
Guest
 
Posts: n/a
Default How to detect Exchange?


Hi,

Is there a way to programatically determine whether Outlook is running in an
Exchange environment, or in a simple POP3/SMTP setup?

More specifically, is there a way to find out whether the
Redemption::MAPIUtils:eliverNow() will work as expected, or whether the
simulated click on the Send/Recv toolbar button is required?

Thanks in advance!
Martynas

  Reply With Quote
Old 07-07-2003, 03:00 PM   #2
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: How to detect Exchange?

Using CDO 1.21 code:

Private Function Exchange() As Boolean
Dim objInfostore As MAPI.InfoStore
Dim objCDO As MAPI.Session

On Error Resume Next

Set objCDO = CreateObject("MAPI.Session")
objCDO.Logon "", "", False, False
Set objInfostore = objCDO.GetInfoStore(objCDO.Inbox.StoreID)

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

Exchange = True
Else
Exchange = False
End If
Else
Exchange = False
End If

Set objInfostore = Nothing
End Function

A quick and dirty way using the Outlook object model would be to get
Inbox.Parent and see what the folder name is:
If InStr(1, strFolderName, "Mailbox", vbTextCompare) > 0 Then
'using Exchange mailbox
End If

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


"Martynas Kunigelis" <kunigelis@centras.lt> wrote in message
news:#pi#2WiQDHA.3192@tk2msftngp13.phx.gbl...
> Hi,
>
> Is there a way to programatically determine whether Outlook is

running in an
> Exchange environment, or in a simple POP3/SMTP setup?
>
> More specifically, is there a way to find out whether the
> Redemption::MAPIUtils:eliverNow() will work as expected, or

whether the
> simulated click on the Send/Recv toolbar button is required?
>
> Thanks in advance!
> Martynas
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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