Menubar stops responding af "New e-mail"

Add-in Express™ Support Service
That's what is more important than anything else

Menubar stops responding af "New e-mail"
Menubar on Explorer stops responding to click events after a new mail 
Bargholz Thomas




Posts: 242
Joined: 2006-12-18
I'm creating a menubar on the adxOutlookEvents_NewExplorer event. The menu is available from the main Outlook explorer window, which is what I want.
Offly enough, it's also available from the "Read E-mail" inspector (which I don't want it to be) and the "New E-mail" inspecter (which I don't want either).
So I as wondering why an Explorer menubar also appear on e-mail inspectors (and not on any other inspector).

Another problem is that the menubar on the "new e-mail" inspector has a couple of the menubuttons appearing more than once. The menubar is correct on the "Read e-mail" inspector and (of course) on the main Outlook explorer.

The "New E-mail" inspector uses Word as the mail editor. Don't know if that has an impact on the situation.

I have a small sample that I can send you if you need it.

Regards
Thomas

Posted 20 Dec, 2006 04:05:52 Top
Bargholz Thomas




Posts: 242
Joined: 2006-12-18
Oh, and last (and the verious serious) issue:
After the "New E-mail" inspector has been opened, the menubar on the Outlook explorer stops responding. It no longer reacts to the Click events.
Menubars on Read and New E-mail inspectors do work.
Posted 20 Dec, 2006 04:06:55 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Bargholz.

1. Yes, please send the example.
2. What menu buttons do you mean?

P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 20 Dec, 2006 13:12:11 Top
Bargholz Thomas




Posts: 242
Joined: 2006-12-18
I have modified a sample from you, which loads a menuba and items dynamically when a new inspector is opened. I've changed it so that it performs the exact same thing when a new Explorer opens instead.

The first problem with dublicate menuitems I can recreate here, so that is a problem with my code.
But you get the explorer menubar on both Read and New e-mail windows - why is that? Shouldn't that be Inspector windows and not Explorer windows?

But the serious problem is there: Click one of the actions in the main Outlook window and you get a response. Now create a new e-mail, and click a menuitem in the new e-mail window. You get a response just fine. Now close the new mail window and return to the main Outlook explorer window - click on a menuitem from the custom menubar, and nothing happens.

Download the sample:
http://www.lector.dk/download/ax_problems_sample.zip

Regards
Thomas
Posted 21 Dec, 2006 02:30:22 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Thomas.

The code will work properly if you change it as shown below:

private void adxOutlookEvents_NewExplorer(object sender, object explorer)
{
Outlook._Explorer explObj =
explorer as Outlook._Explorer;

this.CommandBarsObj = null;
// add a new bar or connect to the existing one
myBar = this.CommandBarAdd(typeof(AddinExpress.MSO.ADXCommandBar), "My Dynamic Bar",
AddinExpress.MSO.ADXMsoBarPosition.adxMsoBarTop, true);
if (myBar != null)
{
AddinExpress.MSO.ADXCommandBarControl ctrl;

AddControl(myBar, typeof(AddinExpress.MSO.ADXCommandBarButton),
"My Action", "MY_UNIQUE_TAG 1", 0, true, new AddinExpress.MSO.ADXClick_EventHandler(DoClick), true);
AddControl(myBar, typeof(AddinExpress.MSO.ADXCommandBarEdit),
"", "MY_UNIQUE_TAG 2", 0, true, new AddinExpress.MSO.ADXChange_EventHandler(DoChange), true);

ctrl = AddControl(myBar, typeof(AddinExpress.MSO.ADXCommandBarPopup),
"My Popup Menu", "MY_UNIQUE_TAG 3", 0, false, null, true);
AddControl(ctrl, typeof(AddinExpress.MSO.ADXCommandBarButton),
"Popup Item 1", "MY_UNIQUE_TAG 4", 0, false, new AddinExpress.MSO.ADXClick_EventHandler(DoClick), true);
AddControl(ctrl, typeof(AddinExpress.MSO.ADXCommandBarButton),
"Popup Item 2", "MY_UNIQUE_TAG 5", 0, false, new AddinExpress.MSO.ADXClick_EventHandler(DoClick), true);
AddControl(ctrl, typeof(AddinExpress.MSO.ADXCommandBarButton),
"Popup Item 3", "MY_UNIQUE_TAG 6", 0, false, new AddinExpress.MSO.ADXClick_EventHandler(DoClick), true);

AddControl(myBar, typeof(AddinExpress.MSO.ADXCommandBarButton),
"Clear Popup", "MY_UNIQUE_TAG 7", 0, true, new AddinExpress.MSO.ADXClick_EventHandler(DoClear), true);
myBar.Visible = true;
}
}
Posted 21 Dec, 2006 10:11:54 Top