More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

forum 18-Dec-2018 14:47

Looking for help with Outlook programming projects — VSTO, add-ins, VBA, custom Outlook forms, etc.? You′ve come to the right place!

NEW! >> Subscribe to this site via RSS. For more RSS options, see the complete list of feeds on our main news page.

    Page [ 1 ]  
 Outlook and .NET Printer Friendly Version
Writing code with C# and VB.NET to create Outlook add-ins and other projects
Topic
QueryInterface for interface Outlook._Application failed
Hi,

I am not sure if this problem has been discussed before. I could not find it in the archives.

I have an Outlook addin in VB .NET that works for Outlook 2000, XP and 2003. I had installed Outlook 2003 on my machine and I had to uninstall it and install Office XP instead.

After doing that, I have started getting error saying "QueryInterface for interface Outlook._Application failed" when I try to invoke Outlook application from within my code.

Funnily, the other functionality of the addin works. Only it fails to "load the dll" in following code:
            Private ol As Outlook.Application
            Private ns As Outlook.NameSpace
            ol = New Outlook.Application;
            ns = ol.GetNamespace("MAPI"); ----> This statement throws
                                                                                 that 'QueryInterface' exception
            LaunchOutlook();

I think that it has to do with downgrading my Office suite from Office 2003 to Office XP. But I am not able to find exact error.

The addin was working fine with Outlook 2003.

Thanks in advance for any help.

Thanks,
Kedar


 

  31-May-2005  17:25
  31-May-2005  17:37   
Maybe a dumb question, but did you download and install the Office XP PIAs?
  08-Jun-2005  19:06   
Hi Sue,

Thanks for your response. I did install the Office XP PIAs.

I was able to resolve the issue. It had to do with a Office 2003 registry key still remaining in Registry.

In the following path in registry, there were 2 sub-entries one for 9.1 (Office 10) and other for 9.2 (Office 11):

HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}\9.1
                                                                                                                                                 \9.2

When my code tried to launch the Outlook, it was looking at latest entry (9.2) and hence was trying to get Interop.Outlook for Office 2003 rather than Office XP. I deleted the 9.2 entry and now it is working fine.

Thanks,
Kedar
 
  16-Oct-2006  17:59   
Thanks, that's helped me too.
  12-Apr-2007  14:50   
Thanks a lot, it also helped me too mucho.
  23-Aug-2007  04:33   
Hi Kedar,

The solution suggested by you is also helped me

Thanks A Lot

Good RND
    Page [ 1 ]