How to add button to toolbar of Outlook window appears after choosing “Send to Mail > Recipient” on file.

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

How to add button to toolbar of Outlook window appears after choosing “Send to Mail > Recipient” on file.
 
David Potashinsky




Posts: 31
Joined: 2010-02-14
We have a problem to add toolbar button to “Send to > Mail Recipient” windows of outlook.

Regular button is added to outlook by fallowing code and works fine:

public class AddInFramework : AddinExpress.MSO.ADXAddinModule
{
private ADXOlInspectorCommandBar m_SIInspectorCommandBar;
private ADXCommandBarButton m_MyOutlookMailButton;
…………
private void InitializeComponent()
{
this.m_SIInspectorCommandBar = new AddinExpress.MSO.ADXOlInspectorCommandBar(this.components);
this.m_MyOutlookMailButton = new AddinExpress.MSO.ADXCommandBarButton(this.components);


this.m_MyOutlookMailButton.Caption = Constants.MY_BUTTON_CAPTION;
this.m_MyOutlookMailButton.ControlTag = "1cb783f1-d73b-4b33-84ca-3efc30f6111a";
this.m_MyOutlookMailButton.Image = 0;
this.m_MyOutlookMailButton.ImageList = this.m_ShieldBitmap16ImageList;
this.m_MyOutlookMailButton.ImageTransparentColor = m_ShieldBitmap16ImageList.TransparentColor;
this.m_MyOutlookMailButton.St yle = AddinExpress.MSO.ADXMsoButtonStyle.adxMsoButtonIcon;
this.m_MyOutlookMailButton.Temporary = true;
this.m_MyOutlookMailButton.TooltipText = BUTTON_TOOLTIP;
this.m_MyOutlookMailButton.UpdateCounter = 14;
this.m_MyOutlookMailButton.Click += new AddinExpress.MSO.ADXClick_EventHandler(this.MyOutlookMailButton_Click);


this.m_SIInspectorCommandBar.CommandBarName = "E-mail";
this.m_SIInspectorCommandBar.CommandBarTag = "0a1eac80-e60d-4943-be4b-e00642e395ce";
this.m_SIInspectorCommandBar.Controls.Add(this.m_MyOutlookMailButton);
this.m_SIInspectorCommandBar.Temporary = true;
this.m_SIInspectorCommandBar.UpdateCounter = 22;
}

The problem is happening than user right click on some file, choose “Send To” > “Mail Recipient” in context menu of file. New window of outlook is opened but with no button added by our code.

How can we solve it?

The problem is appears on windows XP (SP3) / Outlook 2003 (SP3).

Thank you in advance,
We bought your product and so far we are pleased with it.
David.
Posted 14 Feb, 2010 04:50:39 Top
Andrei Smolin


Add-in Express team


Posts: 15280
Joined: 2006-05-11
Hi David,

Thank you for the kind words.

Unfortunately, your problem is a well-known Outlook issue: it doesn't fire InspectorActivate for inspector windows opened in this way. You can try tracking open inspectors and run that code if you find an inspector that is opened without being checked by you. But there is a problem: you cannot use the Outlook object model as well as other Office object models in a thread because the object models are not thread-safe. So, the true workaround would be counting Inspector windows using Win32 API. This is a hard way but it seems there's no other one.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Feb, 2010 04:11:40 Top
Shmulik Peled




Posts: 1
Joined: 2010-02-21
Hi Andrei,

My colleague David is asking about the button that we have added using AddinExpress infrastructure.
are you saying that because of Outlook send-to problem this feature of AddinExpress doesn't work
when doing send-to message?

Thanks again,
Shmulik.
Posted 21 Feb, 2010 15:14:09 Top
Andrei Smolin


Add-in Express team


Posts: 15280
Joined: 2006-05-11
Hi Shmulik,

Yes, that's true. Note that Microsoft had known about the issue and they solved it in Outlook 2007 inspectors.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 22 Feb, 2010 04:45:48 Top