Reaching local Outlook AND Exchange...

R

Rodzilla

We have a Windows forms application that is installed on all sorts of personal computers...some running Outlook locally, some using various combinations of local files and Exchange...and of course a happy mixture of OL2002 AND ol2003 just to add some excitement...the code below fails when Exchange is any part of the user's mix...and works fine when Exchange is NOT part of the equation...


--------------------------------------------------------------------------------
Dim oApp As Object = CreateObject("Outlook.Application")
Dim oNS As Object

oNS = oApp.GetNamespace("mapi")

oNS.Logon(, , False, False)


--------------------------------------------------------------------------------


The error message is "Cannot create Active X component"......

Is there any way for a Windows form application to open/reach Outlook when Exchange is part of the user's world?

Thanks in advance for any help...

Rod Kimmel
 
S

Sue Mosher [MVP-Outlook]

Look for antivirus applications with slightly paranoid script blockers that
don't allow access to CreateObject("Outlook.Application").

Once you get beyond that statement, you might try showing the Logon dialog.
Your Logon statement probably may not always result in a valid session.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



We have a Windows forms application that is installed on all sorts of
personal computers...some running Outlook locally, some using various
combinations of local files and Exchange...and of course a happy mixture of
OL2002 AND ol2003 just to add some excitement...the code below fails when
Exchange is any part of the user's mix...and works fine when Exchange is NOT
part of the equation...


--------------------------------------------------------------------------------
Dim oApp As Object = CreateObject("Outlook.Application")
Dim oNS As Object

oNS = oApp.GetNamespace("mapi")

oNS.Logon(, , False, False)


--------------------------------------------------------------------------------


The error message is "Cannot create Active X component"......

Is there any way for a Windows form application to open/reach Outlook when
Exchange is part of the user's world?

Thanks in advance for any help...

Rod Kimmel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top