Calling an Add-in method from another Application

D

David

Re: http://www.microsoft.com/communitie...855c&mid=6836500a-e234-489f-b464-19e70f3a855c



My application that attempts to use the externally available call can't seem to get hold of the add-in.
I get the following exception:
System.Runtime.InteropServices.COMException (0x80010001): Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

The calls I am making are:
Outlook.ApplicationClass olApp = new Outlook.ApplicationClass();
Outlook.NameSpace olNS = olApp.GetNamespace("MAPI");
MSOffice.COMAddIns addIns = olApp.COMAddIns;

I do not get the error if Outlook is running before my application starts.

I suspect this is something to do with me trying to access the AddIn before it is loaded - does that sound plausable?

Any thoughts on what I should do?

Thanks
 
K

Ken Slovak - [MVP - Outlook]

Test your hypothesis.

What happens if you use a timer or something to delay checking for the
addins until ActiveExplorer() isn't a null object? Or if you wait say 30
seconds?




Re:
http://www.microsoft.com/communitie...855c&mid=6836500a-e234-489f-b464-19e70f3a855c



My application that attempts to use the externally available call can't
seem to get hold of the add-in.
I get the following exception:
System.Runtime.InteropServices.COMException (0x80010001): Call was
rejected by callee. (Exception from HRESULT: 0x80010001
(RPC_E_CALL_REJECTED))

The calls I am making are:
Outlook.ApplicationClass olApp = new Outlook.ApplicationClass();
Outlook.NameSpace olNS = olApp.GetNamespace("MAPI");
MSOffice.COMAddIns addIns = olApp.COMAddIns;

I do not get the error if Outlook is running before my application starts.

I suspect this is something to do with me trying to access the AddIn
before it is loaded - does that sound plausable?

Any thoughts on what I should do?

Thanks
 

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