Wuschba

Hi. I'm just trying to connect to Outlook 2003 from my C#-Application on Vista. I added "Microsoft Outlook 11.0 Object Library" to the references of my object, and then I'm calling:

using Outlook = Microsoft.Office.Interop.Outlook;
...
[STAThread]
static void Main(string[] args)
{
Outlook.Application application = new Outlook.Application();
}

Thats all, but I get the error: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.

I found http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1787418&SiteID=1 suggesting that it could due to Virus-Scanners that protect Outlook, but deactivating the scanner didn't help... Any other idea what could be wrong



Re: Visual Studio Tools for Office Error while creating Outlook-Application-Object on OL2003/Vista?

Sue Mosher - Outlook MVP

Did you install the Office 2003 PIAs Does your project's reference for Outlook point to the GAC



Re: Visual Studio Tools for Office Error while creating Outlook-Application-Object on OL2003/Vista?

Wuschba

Thanks for your reply. Yes, I installed the PIAs. What do you mean with the GAC (how do I do that)

I just discovered that it works when Outlook is closed. With Outlook running, it doesn't work. Is it a condition that Outlook has to be closed when connecting from a C#-Application !





Re: Visual Studio Tools for Office Error while creating Outlook-Application-Object on OL2003/Vista?

Sue Mosher - Outlook MVP

Make sure the reference you're using is the one in the \Windows\Assembly folder. If you're unfamiliar with the GAC, this article might be useful: http://www.codeproject.com/dotnet/DemystifyGAC.asp

External applications can automate Outlook whether Outlook is already running or not. What are you trying to accomplish from with Outlook your external application

Note that this is a forum for discussion add-ins and document applications using the VSTO architecture. There is a newsgroup specifically for general Outlook programming issues "down the hall" at http://www.microsoft.com/office/community/en-us/default.mspx dg=microsoft.public.outlook.program_vba





Re: Visual Studio Tools for Office Error while creating Outlook-Application-Object on OL2003/Vista?

Wuschba

Thanks again for your help. The assembly is C:\Windows\assembly\GAC\Microsoft.Office.Interop.Outlook\11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Outlook.dll
so I think this is correct. But still the error occurs.

I just want to import some bodys of mail-items into my application. Didn't thought that would be so much trouble.

I will try the newsgroup then, so thanks again!





Re: Visual Studio Tools for Office Error while creating Outlook-Application-Object on OL2003/Vista?

Wuschba

I found some more time to do testing on this. It seems that the UAC of Vista is causing the error: It works when UAC is disabled. Any ideas about that Is this ment by design





Re: Visual Studio Tools for Office Error while creating Outlook-Application-Object on OL2003/Vista?

Sue Mosher - Outlook MVP

Have you installed the fix described at http://support.microsoft.com/ kbid=937652