views:

192

answers:

3

When creating an VSTO Outlook AddIn there are some restrictions which are a bit annoying. For example if you start Outlook due to a click on a mail link, no addins are loaded due to security reasons.

Is there a way to override this behaviour? Maybe an alternate way of creating an Addin without using VSTO? If I remember correct there are ways of creating Addins by using some different technology then VSTO, but which one and what are the differences?

+1  A: 

There are older, more painful, ways of creating add-ins but I don't believe they would solve your problem. The solution that I have seen and used is to detect if you can get the ActiveExplorer and if not, tell the user to start the program normally.

An example of doing this can be seen in the source for the Outlook Attachment Reminder source on Codeplex.

http://www.codeplex.com/OAR/Release/ProjectReleases.aspx?ReleaseId=22094

Kevin
A: 

Macros are another way...

The above from Codeplex uses VSTO.

As Kevin mentioned we need to figure out why the Addin is not loaded... In the Addin above, a menu is created everytime there;s an active explorer...

As far as I know the Addin is not loaded due to Microsoft security restrictions. Image you have infected a PC with a malicous addin and let the user click on a mailto Link which will instantly open Outlook. The malicous Addin would be loaded and do whatever it is supposed to. To prevent Outlook from loading potential malicous code automatically, Addins are only loaded when the user explicitly opens Outlook. At least I think that I've read this somewhere...
Marcus
This is not the reason that the addin is not loaded. Mailto: is a direct MAPI subsystem call. MAPI calls the default mail client (outlook) and tells it to create a message item. If it was a security problem you'd get a security prompt, which you don't.
Anonymous Type
+1  A: 

wrong. Mailto link is using a different method of calling outlook under the OS covers. Mailto calls straight into the MAPI subsystem via an OS call, which then triggers Outlook (as it will be the default MAPI client).

when you are using the New button inside Outlook your using Outlook OM code and the addin is already loaded.

The key difference here is simple - Outlook is already loaded. you can still use VSTO to target this scenario, you just need to ensure you load at startup. If you are only adding the VSTO component when the message (active Inspector is "added") then that is too late for this scenario. Are you sure that your addin is set to load on startup?

Anonymous Type