views:

89

answers:

1

I've created an Outlook 2007 AddIn that among other things has to perform some actions when user creates a new email. I've hooked to proper events and everything works correctly in all but one case.

The problem is that if Outlook is not running and user clicks mailto URL then Outlook opens only one explorer where user can compose the email. The other parts of the app are not loaded at that time. The problem is that in this case my plugin is not loading so I cannot add my custom code there.

I'd like to know if there's a way to overcome this problem.

I see two possible solutions but I don't know if they are possible.

  • Make plugin load on mailto links (one explorer mode). I suspected this would be provided out-of-the-box by VSTO but it's not. I couldn't find anything about that on MSDN nor MS Outlook Programming book.
  • Change mailto URL handler on client machine to launch full Outlook (like you would click Outlook shortcut) instead of just one Explorer. This would load my plugin before opening email explorer and would probably work as I intended.

Does anyone knows if any of that solutions is possible? Or maybe you have another that might work.

+2  A: 

I had the same problem too but with Outlook 2003. The reason for this behaviour is security. Imagine a user installs an evil addin by mistake, which answers to mailto links and therefore does some evil stuff...

In my case I have developed a workaround. Instead of using the mailto links, I have created an own link (it's a simple shell extension which can easily be created look here) which starts a little helper application. This helper applications starts Outlook in full mode ( Outlook.exe /recycle) after having a little check for the load behaviour value (must be set to "3").

This way you can start Outlook in fullmode in order to use your addin ;)

Marcus
I know this can be done with custom URL handler. In fact it's how I have it done at the moment. However I was looking for a way I could avoid installing URL handler and just changing Outlook behavior. If what you say is true then there's no way of improving that without URL handler.
RaYell
Hm... Instead of creating a new handler you could change the original one... It is possible to let the original mailto handler start the helper add. This way you could achiede a full start of Outlook by clicking on a mailto link... But in my opinion its a better way creating your own handler. Changing the Outlook behaviour would be the nicest solution. I have searched a lot for this topic but it seams to me that there is no solution.
Marcus