Massimo555971

Hi All,

I¡¯m using Visual Studio 2005 Tools for the Microsoft Office System Second Edition to implement Outlook add-ins in C#.

Once I run the setup application that VSTO creates, then the add-in is correctly load by Outlook as it starts. The add-in add some menu buttons to the email inspectors.

The problems begin when I open the email inspectors by entry ID from a different project using c# code. If Outlook is already running (and hence the add-in is already loaded) then all works fine and the inspectors are opened with the menu buttons added be my add-in, but if Outlook is not running (and hence the add-in is not loaded, I think) then the email inspectors are opened without my menu buttons. Furthermore if I then open Outlook it does not load the add-in anymore and I¡¯m forced to select it again from the Outlook available COM components window.

Why does it happens

Have anyone an idea how to solve this problem

Thank you for the help.

Massimo




Re: Visual Studio Tools for Office problems loading add-ins when opening email inspectors from c# code

Helmut Obertanner

Hello Massimo,

my Idea is: maybe if you just create an Inspector window from another application, maybe your startup code looks for an explorer and there isn't one and it crashes.

I would try to implement some logging code to figure it out what went wrong.

I have a few samples here.

http://www.x4u.de/Outlook/Codesnippets/tabid/61/Default.aspx

Hope it helps,

greets, Helmut






Re: Visual Studio Tools for Office problems loading add-ins when opening email inspectors from c# code

Massimo

Helmut,
thenk you for your help.
What I have seen looking further is this: if I start debugging the add-in code, then the menu buttons are present in Outlook, but if I try to install the add-in using the autogenerated VSTO setup project, then Outlook is not able to load the add-in because it cannot find a COM object.
Maybe the add-in is not really installed.
Very difficult to understand for me!

Massimo





Re: Visual Studio Tools for Office problems loading add-ins when opening email inspectors from c# code

Massimo

Helmut,
thankyou for the help.
What I have discovered looking further is this: if I run the VSTO add-in project in debug mode, the the added buttons appear in Outlook, but if I install the add-in using the autogenerated VSTO setup project, then Outlook is not able to load the add-in because it cannot load a COM object.
Very difficult to understand to me (maybe the add-in have never been installed really).

Ciao
Massimo





Re: Visual Studio Tools for Office problems loading add-ins when opening email inspectors from c# code

Helmut Obertanner

Hello Massimo,

It's not easy.

Make sure you have the following prerequisites installed on the target machine:

.Net Framework 2.0

.Outlook (same Version)

.Office PIA's

.VSTO SE runtime (vstor.exe)

Hope this helps,

greets, Helmut






Re: Visual Studio Tools for Office problems loading add-ins when opening email inspectors from c# code

Misha Shneerson - MSFT

I think you are running into the same issue as described in this thread.






Re: Visual Studio Tools for Office problems loading add-ins when opening email inspectors from c# code

Massimo

Misha,
thank you for your help.
You have exactly understood my problem.

Ciao
Massimo