View Single Post
  #4  
Old August 11th, 2006, 10:42 PM posted to microsoft.public.outlook.contacts
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 7,177
Default .NET Programmatically accessing Exchange shared and public fol

If Outlook isn't running, you'd want to use either

olns.Logon "profile_name", "", False, True

or possibly

olns.Logon "", "", True, True

This is a standalone Windows application? Check to see whether your anti-virus client has script blocking turned on.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"DeborahK" wrote in message ...
Hi Sue -

Thank you for replying to my question. We tried that with several different
types of parameters (no parameters, all parameters, etc) and that did not
help. It still generates an error on the GetFolderFromID statement.

"Sue Mosher [MVP-Outlook]" wrote:

If Outlook hasn't been started yet, you can use the Namespace.Logon method to start it with a particular mail profile.

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/comm....program_v ba

"DeborahK" wrote in message ...
I am trying to programmatically access Exchange shared and public folders via
Outlook from a .NET application.

Here is the line of code that is generating an error:

Dim olns As Outlook.NameSpace = OutlookInstance.GetNamespace("MAPI")
mapiFolder = olns.GetFolderFromID(folderID, storeID)

The error is:
"The messaging interface has returned an unknown error. If the problem
persists, restart Outlook".

I don't get the error message when accessing the user's default mailbox. I
also don't get the error message if the user manually opens Outlook before
using my application.

The application is correctly loading Outlook using:
' Create the instance of outlook
_OL = New Outlook.Application
I know this because I can see Outlook being added to the Task Manager.

I have been struggling with this for days so if anyone has ideas I would
appreciate them.

THANKS!