Mike Medved
Guest
|
Doing development in C#, VS 2010. Add-in Express 2010. Currently testing on Outlook 2010 but will need it to work on 2003 and up.
I need to Show/Hide the built in HOME tab at runtime, depending on which folder is being viewed. I tried implementing the suggestion at http://www.add-in-express.com/forum/read.php?FID=1&TID=7637&MID=38369
However it does not seem to be working as expected. Whatever I set the Visible property to the first time the FolderSwitch event occurs is what it sticks to. Subsequent changes to the property seem to be ignored, even if the RibbonUI is invalided.
Here is a sample of the code:
private void AddinModule_OnRibbonLoaded(object sender, IRibbonUI ribbon)
{
theRibbonUI = ribbon;
}
private void adxOlFormsManager1_ADXBeforeFolderSwitch(object explorerObj, AddinExpress.OL.ADXOlFormsCollectionItem SrcItem, object SrcFolder, AddinExpress.OL.ADXOlFormsCollectionItem DstItem, object DstFolder)
{
string sName = (DstFolder as Outlook.MAPIFolder).Name;
// Default home ribbon to be hidden for the TEST folder
showHomeRibbon = (sName != "TEST Tasks");
}
private void adxOutlookEvents_ExplorerFolderSwitch(object sender, object explorer)
{
adxRibbonTaskListExplorer.Visible = showHomeRibbon;
try
{
theRibbonUI.InvalidateControl(adxRibbonTaskListExplorer.Id);
}
catch (Exception) { }
}
Could you let me know what I am doing wrong? |
|
Eugene Astafiev
Guest
|
Hi Mike,
Please note that the Tab activation feature was added in Office 2010. For more information please have a look at the http://msdn.microsoft.com/en-us/library/ee691834.aspx article in MSDN.
FYI Please have a look at the ActivateRibbonTabMso method of the add-in module class. |
|
Jerry Medved
Posts: 1
Joined: 2010-10-19
|
Eugene,
If I understand it correctly, Activate is just for bringing the tab to the foreground. That is not the issue for me. I need to either hide it entirely or show it, and leave it to the user to actually select it. And would need to do that on both 2007 and 2010.
I can show or hide the tab, but only once. Once I hide it, cannot show it again. Thats the problem. |
|
Eugene Astafiev
Guest
|
|
Mike Medved
Guest
|
hmm, I see. I thought you could still show/hide the tab dynamically, like you can with buttons and groups.
Thanks for the help. |
|
Eugene Astafiev
Guest
|
Hi Mike,
This is a bug. I have just filed the mentioned issue in our bug-tracking system under #2109. We will publish a new build of Add-in Express 2010 on our web site soon.
Thank you for pointing this to me. |
|