I have successfully created an addin for Outlook which shows/hides a custom task pane using a ribbon toggle button by following this link.
The problem I have is it works fine for one instance of Outlook, but as soon as I open another instance pressing the ribbon button only controls the addin on the first instance.
The ribbon code:
public partial class ManageTaskPaneRibbon
{
private void ManageTaskPaneRibbonLoad(object sender, RibbonUIEventArgs e)
{
btnToggle.Tag = Guid.NewGuid().ToString();
}
private void BtnToggleClick(object sender, RibbonControlEventArgs e)
{
Globals.ThisAddIn.TaskPane.Visible = ((RibbonToggleButton)sender).Checked;
}
}
I need the 2 instances to be completely separate in operation so they can work independently from each other.