View Single Post
  #2  
Old January 9th 09, 10:02 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Reference to AddIn

You need to make the addin COM visible and then depending on whether or not
it's a VSTO addin make public a reference to the addin if you want to call
on methods or properties of the addin.

I don't have anything for VS 2008, but I do have C# templates for VS 2005
for both shared addins and VSTO 2005SE addins that shows how to expose your
addin and methods/properties in it to outside code. You can find them at
http://www.slovaktech.com/outlook_2007_templates.htm. The templates are all
Outlook 2007 specific.

To just reference the addin as an Office.COMAddIn you would use code
something like this assuming olApp is your Outlook.Application object
reference:

Office.COMAddIn addin = olApp.COMAddIns.Item("MyAddinName");

If your addin is shared and uses a Connect class that would look like this:
"MyAddinName.Connect".

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Nenad" wrote in message
...
I am programming Outlook 2003 AddIn using Visual Studio 2008 and C#.

I need to pass a reference to AddIn to user control embedded in Folder
Home
Page, but it is always a null. I already found out that it's a security
barrier which prevents passing a reference.

Did anyone knows any other way to pass a reference to C# AddIn?

Thanks, Nenad


Ads