Outlook 2007 Add-in strange load behavior
First of all I'm not sure how VSTO is handling what is called a headless
Outlook. That's an Outlook that has no UI. Are you getting the Startup()
event when Excel starts Outlook? If not you need to display a UI by using
the GetExplorer() method. If that doesn't work you will need to post to the
VSTO forum at the MSDN forums to see what the VSTO team says about that
problem.
In the second problem you are seeing Simple MAPI items opened by sending
mail from Excel and not using the Outlook object model to do that instead. A
Simple MAPI Inspector is opened modally. It also will not start a VSTO
addin. Simple MAPI Inspectors do not fire NewInspector() when they are
opened. They do get added to the Inspectors collection, but no event fires
to tell you that.
--
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
"SomewhereSomehow" wrote in
message ...
Hello all!
I'm experiencing some problems with outlook add-in loading if outlook was
loaded by means of Excel, Word and so on.
Here is what i'm doing:
1) Create an empty Outlook Add-in project using Visual Studio 2008, new
Project - Visual C# - Office - 2007 -
Outlook 2007 Addin
2) Into the start up method add the following
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
System.IO.StreamWriter sw = new
System.IO.StreamWriter("c:\\AddinTest.txt");
sw.WriteLine("");
sw.Close();
}
3) Run the project. Outlook starts. See that file was created on c:
4) delete file
5) Run Outlook as it self (not from debugger) and see c:, file was created
again. Delete it.
6) Run Excel 2007, then in office menu select Send, as email. Outlook new
message form is shown, new excel work
book is packed as an attach to this letter. Look at c:. NO file was
created!!!
7) press CRTL+SHIFT+ESC, to start task manager, to be sure that outlook
was
started. Yes you can see process
OUTLOOK.EXE in the list.
8) Still no file.
9) Close new message window, wait for 1-2 sec.
10) Look at the c:! What a surprise! here is our file!
1) So, my first question is, why it has so weird behavior?
2) And the second onr is how to avoid this problem?
Because in my real addin, I need to customise ribbon (add one combobox)
when
the new message is created and
everything is fine, if I do it directly from the Outlook (or outlook is
started and i'm doing it from excel), but
it fails if Excel starts Outlook by it's own
And another one problem is detected!
Only If the ribbon is added to project.
if i open outlook first, then excel (add-in starts ok) and try to send
email
from excel - the message window stays on the screen.
And it is interesting that all controls and ribbons are available and the
content box look's like in a hung state, no redrawing. Pressing a croos to
close window closes it without any arror.
Also if I just create new message from excel, and then try to close it, it
still remains on the screen (as in send case). Pressing Close once again -
closes window.
This is completely strange!
Any one may take an experiment just add Ribbon to the project, with no
user
code.
I also tried to download a Hello all!
I'm experiencing some problems with outlook add-in loading if outlook was
loaded by means of Excel, Word and so on.
Here is what i'm doing:
1) Create an empty Outlook Add-in project using Visual Studio 2008, new
Project - Visual C# - Office - 2007 -
Outlook 2007 Addin
2) Into the start up method add the following
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
System.IO.StreamWriter sw = new
System.IO.StreamWriter("c:\\AddinTest.txt");
sw.WriteLine("");
sw.Close();
}
3) Run the project. Outlook starts. See that file was created on c:
4) delete file
5) Run Outlook as it self (not from debugger) and see c:, file was created
again. Delete it.
6) Run Excel 2007, then in office menu select Send, as email. Outlook new
message form is shown, new excel work
book is packed as an attach to this letter. Look at c:. NO file was
created!!!
7) press CRTL+SHIFT+ESC, to start task manager, to be sure that outlook
was
started. Yes you can see process
OUTLOOK.EXE in the list.
8) Still no file.
9) Close new message window, wait for 1-2 sec.
10) Look at the c:! What a surprise! here is our file!
1) So, my first question is, why it has so weird behavior?
2) And the second onr is how to avoid this problem?
Because in my real addin, I need to customise ribbon (add one combobox)
when
the new message is created and
everything is fine, if I do it directly from the Outlook (or outlook is
started and i'm doing it from excel), but
it fails if Excel starts Outlook by it's own
And another one problem is detected!
Only If the ribbon is added to project.
if i open outlook first, then excel (add-in starts ok) and try to send
email
from excel - the message window stays on the screen.
And it is interesting that all controls and ribbons are available and the
content box look's like in a hung state, no redrawing. Pressing a croos to
close window closes it without any arror.
Also if I just create new message from excel, and then try to close it, it
still remains on the screen (as in send case). Pressing Close once again -
closes window.
This is completely strange!
Any one may take an experiment just add Ribbon to the project, with no
user
code.
I also tried to download a Hello all!
I'm experiencing some problems with outlook add-in loading if outlook was
loaded by means of Excel, Word and so on.
Here is what i'm doing:
1) Create an empty Outlook Add-in project using Visual Studio 2008, new
Project - Visual C# - Office - 2007 -
Outlook 2007 Addin
2) Into the start up method add the following
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
System.IO.StreamWriter sw = new
System.IO.StreamWriter("c:\\AddinTest.txt");
sw.WriteLine("");
sw.Close();
}
3) Run the project. Outlook starts. See that file was created on c:
4) delete file
5) Run Outlook as it self (not from debugger) and see c:, file was created
again. Delete it.
6) Run Excel 2007, then in office menu select Send, as email. Outlook new
message form is shown, new excel work
book is packed as an attach to this letter. Look at c:. NO file was
created!!!
7) press CRTL+SHIFT+ESC, to start task manager, to be sure that outlook
was
started. Yes you can see process
OUTLOOK.EXE in the list.
8) Still no file.
9) Close new message window, wait for 1-2 sec.
10) Look at the c:! What a surprise! here is our file!
1) So, my first question is, why it has so weird behavior?
2) And the second onr is how to avoid this problem?
Because in my real addin, I need to customise ribbon (add one combobox)
when
the new message is created and
everything is fine, if I do it directly from the Outlook (or outlook is
started and i'm doing it from excel), but
it fails if Excel starts Outlook by it's own
And another one problem is detected!
Only If the ribbon is added to project.
if i open outlook first, then excel (add-in starts ok) and try to send
email
from excel - the message window stays on the screen.
And it is interesting that all controls and ribbons are available and the
content box look's like in a hung state, no redrawing. Pressing a croos to
close window closes it without any arror.
Also if I just create new message from excel, and then try to close it, it
still remains on the screen (as in send case). Pressing Close once again -
closes window.
This is completely strange!
Any one may take an experiment just add Ribbon to the project, with no
user
code.
I also tried to download a OutlookRibbonXCS_VSTO example from microsoft,
and
replaced COntact inspector with mail inspector - got the same strange
behavior as in empty project. So i think it's a bug.
Any ideas how to struggle that?
Thank you!
|