Outlook Message Tab Missing

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

Outlook Message Tab Missing
Message Tab Missing  
Cathy Schaeffer


Guest


I'm having an issue which I see discussed on this site, but with no resolution.

"In Outlook 2007 with our plug-in loaded, if we create a new email ,the Message tab is missing sometimes .This behavior is intermittent and can be resolved if we restart the outlook or disable the plug-in. This issue is reported by one of our customer which is using our plug-in but we are not able to replicate the issue at our environment."

The only difference is we see this when reading an email, as opposed to creating one. It's very intermittent, but certain users see it much more often than others.

We have 32-bit Outlook 2010, with Visual Studio 2010, Version 4.0.30319 SP1 Rel

Add-in express adxloader.dll is dated 9/15/11.

I've turned on "Show add-in user interface errors", but the only error that displayed was for Excel, not Outlook. It was fixed late last week. Could it have caused this? If not, what further action can be taken to track this down. It's very annoying for the users who get it most often.

Please advise. Thank you.
Cathy
Posted 28 Jan, 2013 12:44:28 Top
Andrei Smolin


Add-in Express team


Posts: 18842
Joined: 2006-05-11
Hello Cathy,

Although many times reported about built-in tabs sporadically missing if you add a Ribbon control with an image on it, we cannot reproduce the issue in our test environments.

A possible workaround is this. In the OnRibbonBeforeLoad event of the add-in module you modify the Ribbon XML (see e.XML) replacing getVisible="getVisible_Callback" entries with visible="true" for BUILT-IN Ribbon tabs or for the builtin tab demonstrating this behavior.


Andrei Smolin
Add-in Express Team Leader
Posted 29 Jan, 2013 01:18:26 Top
Cathy Schaeffer


Guest


Hi Andrei,

I'm confused. I thought that Outlook did not XML for the ribbon. There are several places in the documentation that says XML applies to Word, Excel and PowerPoint, but not Outlook.

Is the e.xml that comes into the RibbonOnLoad event created on the fly? If not, where does it live and how can I change it?

I printed the e.xml contents, and recognize my commands, but not the ribbons in it.

Can you shed any light?

Thanks much,
Cathy
Posted 07 Feb, 2013 13:27:46 Top
Andrei Smolin


Add-in Express team


Posts: 18842
Joined: 2006-05-11
Hi Cathy,

To customize Ribbon in Outlook 2007 - 2013, you need to supply it. Add-in Express Ribbon components generate the Ribbon XML for you. You can influence how the Ribbon XML is created by creating/deleting/modifying Ribbon components on the add-in module in the OnRibbonBeforeCreate event. In OnRibbonBeforeLoad, the Ribbon XML is generated, it is accessible via e.XML.

Consider using this method:

private string ReplaceGetVisibleWithVisible(string ribbonXML, ADXRibbonTab aBuiltinRibbonTab, bool visible)
{
    string[] lines = 
        ribbonXML.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
    for (int i = 0; i < lines.Length; i++)
    {
        if (lines[i].Contains(aBuiltinRibbonTab.IdMso))
        {
            lines[i] = lines[i].Replace(@"getVisible=""getVisible_Callback""", 
                @"visible="""+ visible.ToString().ToLower() + @"""");
            break;
        }
    }
    string result = string.Empty;
    for (int i = 0; i < lines.Length; i++)
        result += lines[i] + Environment.NewLine;

    return result;
}


You use it in this way:

private void AddinModule_OnRibbonBeforeLoad(object sender, ADXRibbonBeforeLoadEventArgs e)
{
    e.Xml = ReplaceGetVisibleWithVisible(e.Xml, adxRibbonTab1, true);
    e.Xml = ReplaceGetVisibleWithVisible(e.Xml, adxRibbonTab3, false);
}



Andrei Smolin
Add-in Express Team Leader
Posted 08 Feb, 2013 01:30:07 Top
Cathy Schaeffer


Guest


Thank you Andrei. This was immensely helpful. I've implemented it and will let you know whether it makes a difference. I can't tell because it doesn't usually happen to me, but happens fairly frequently with some specific users.

Thanks again.
Cathy
Posted 12 Feb, 2013 18:51:11 Top
Andrei Smolin


Add-in Express team


Posts: 18842
Joined: 2006-05-11
Of course.

Can you please tell me if you use System.Windows.Forms.Application.DoEvents() in your code?


Andrei Smolin
Add-in Express Team Leader
Posted 13 Feb, 2013 00:27:00 Top
Cathy Schaeffer


Guest


No, but I have an Add-in Express Outlook Item Events Class (singular). Is that related?

Cathy
Posted 13 Feb, 2013 10:11:03 Top
Andrei Smolin


Add-in Express team


Posts: 18842
Joined: 2006-05-11
Cathy Schaeffer writes:
Is that related?


I don't think so.


Andrei Smolin
Add-in Express Team Leader
Posted 14 Feb, 2013 01:23:30 Top