Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Calling an Add-in method from another Application

Geek News

Calling an Add-in method from another Application
"David" <maillist[ at ]samarskite.com> 3/12/2007 4:51:18 PM
This is a multi-part message in MIME format.

------=_NextPart_000_0041_01C7648B.FB8FDE50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Re: =
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?&guid=3D=
&sloc=3Den-us&dg=3Dmicrosoft.public.outlook.program_addins&p=3D1&tid=3D68=
36500a-e234-489f-b464-19e70f3a855c&mid=3D6836500a-e234-489f-b464-19e70f3a=
855c



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 =3D new Outlook.ApplicationClass(); =
=20
Outlook.NameSpace olNS =3D olApp.GetNamespace("MAPI");
MSOffice.COMAddIns addIns =3D 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?=20

Any thoughts on what I should do?

Thanks
------=_NextPart_000_0041_01C7648B.FB8FDE50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16397" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Re: <A=20
href=3D"http://www.microsoft.com/communities/newsgroups/en-us/default.asp=
x?&guid=3D&sloc=3Den-us&dg=3Dmicrosoft.public.outlook.program=
_addins&p=3D1&tid=3D6836500a-e234-489f-b464-19e70f3a855c&mid=3D=
6836500a-e234-489f-b464-19e70f3a855c">http://www.microsoft.com/communitie=
s/newsgroups/en-us/default.aspx?&guid=3D&sloc=3Den-us&dg=3Dmi=
crosoft.public.outlook.program_addins&p=3D1&tid=3D6836500a-e234-4=
89f-b464-19e70f3a855c&mid=3D6836500a-e234-489f-b464-19e70f3a855c</A><=
/FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>My application that attempts to use the =
externally=20
available call can't seem to get hold of the add-in.<BR>I get the =
following=20
exception:<BR>System.Runtime.InteropServices.COMException (0x80010001): =
Call was=20
rejected by callee. (Exception from HRESULT: 0x80010001=20
(RPC_E_CALL_REJECTED))</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>The calls I am making =
are:<BR>   =20
Outlook.ApplicationClass olApp =3D new=20
Outlook.ApplicationClass();    <BR>   =20
Outlook.NameSpace olNS =3D =
olApp.GetNamespace("MAPI");<BR>   =20
MSOffice.COMAddIns addIns =3D olApp.COMAddIns;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I do not get the error if Outlook is =
running before=20
my application starts.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I suspect this is something to do with =
me trying to=20
access the AddIn before it is loaded - does that sound plausable? =
</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Any thoughts on what I should =
do?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV></BODY></HTML>

------=_NextPart_000_0041_01C7648B.FB8FDE50--

Re: Calling an Add-in method from another Application
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 3/17/2007 6:33:52 PM
This is a multi-part message in MIME format.

------=_NextPart_000_0146_01C768A1.48DA2DF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

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?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"David" <maillist[ at ]samarskite.com> wrote in message
news:2DE23ACB-231D-4010-B5BB-3F1576491D17[ at ]microsoft.com...
Re:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?&guid=&sloc=en-us&dg=microsoft.public.outlook.program_addins&p=1&tid=6836500a-e234-489f-b464-19e70f3a855c&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

------=_NextPart_000_0146_01C768A1.48DA2DF0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.3059" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Test your hypothesis.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>What happens if you use a timer or =
something to=20
delay checking for the addins until ActiveExplorer() isn't a null =
object? Or if=20
you wait say 30 seconds?</FONT></DIV>
<DIV><BR>-- <BR>Ken Slovak<BR>[MVP - Outlook]<BR><A=20
href=3D"http://www.slovaktech.com">http://www.slovaktech.com</A><BR>Autho=
r:=20
Absolute Beginner's Guide to Microsoft Office Outlook 2003<BR>Reminder =
Manager,=20
Extended Reminders, Attachment Options<BR><A=20
href=3D"http://www.slovaktech.com/products.htm">http://www.slovaktech.com=
/products.htm</A></DIV>
<DIV> </DIV>
<DIV> </DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"David" <<A=20
=
href=3D"mailto:maillist[ at ]samarskite.com">maillist[ at ]samarskite.com</A>> =
wrote in=20
message <A=20
=
href=3D"news:2DE23ACB-231D-4010-B5BB-3F1576491D17[ at ]microsoft.com">news:2DE=
23ACB-231D-4010-B5BB-3F1576491D17[ at ]microsoft.com</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Re: <A=20
=
href=3D"http://www.microsoft.com/communities/newsgroups/en-us/default.asp=
x?&guid=3D&sloc=3Den-us&dg=3Dmicrosoft.public.outlook.program=
_addins&p=3D1&tid=3D6836500a-e234-489f-b464-19e70f3a855c&mid=3D=
6836500a-e234-489f-b464-19e70f3a855c">http://www.microsoft.com/communitie=
s/newsgroups/en-us/default.aspx?&guid=3D&sloc=3Den-us&dg=3Dmi=
crosoft.public.outlook.program_addins&p=3D1&tid=3D6836500a-e234-4=
89f-b464-19e70f3a855c&mid=3D6836500a-e234-489f-b464-19e70f3a855c</A><=
/FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>My application that attempts to use =
the=20
externally available call can't seem to get hold of the add-in.<BR>I =
get the=20
following exception:<BR>System.Runtime.InteropServices.COMException=20
(0x80010001): Call was rejected by callee. (Exception from HRESULT: =
0x80010001=20
(RPC_E_CALL_REJECTED))</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>The calls I am making =
are:<BR>   =20
Outlook.ApplicationClass olApp =3D new=20
Outlook.ApplicationClass();    <BR>   =20
Outlook.NameSpace olNS =3D =
olApp.GetNamespace("MAPI");<BR>   =20
MSOffice.COMAddIns addIns =3D olApp.COMAddIns;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I do not get the error if Outlook is =
running=20
before my application starts.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I suspect this is something to do =
with me trying=20
to access the AddIn before it is loaded - does that sound plausable?=20
</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Any thoughts on what I should =
do?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2>Thanks</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0146_01C768A1.48DA2DF0--

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net