This project has moved and is read-only. For the latest updates, please go here.

Show Ribbon-Tab only in Main-Window (Outlook Addin)

Feb 17, 2015 at 10:57 AM
Dear together

I've successfully developed a Outlook Addin with NetOffice (nearby a great piece of software..). Now the Ribbon is always visible also inside new messages etc.

Is there a way to display the Ribbon only on the Main Window and not inside elements like calendar entries or memos?

I've played arround with the getVisible possibility inside the RibbonUI.xml and was able to hide the ribbon but could not figured out how to determine if the current "Window/Form" (whatever) is the Main Window or a new Message etc..

Does anyone have a input for me, where to serach or probably has a solution for my kind of question?

Thanks for your inputs.

Feb 17, 2015 at 1:27 PM
In NetOffice Tools you have to override the GetCustomUI method and check given argument.
For example:
    public override string GetCustomUI(string RibbonID)
              // empty means main window as far i known...
             return GetMyXMLSchema();
         else if(RibbonID == "Microsoft.Outlook.Mail.Compose")
              // create new mail window
             return GetMyXMLSchema();
check all possible ribbon id's here:

Feb 18, 2015 at 12:24 PM
Hi Sebastian

You brought me to the right path!

At the end I solved it a bit different:
Public Function getVisible(ByVal control As Office.IRibbonControl) As Boolean
            Dim objOutlook As Outlook._Application
            Dim myInspector As Outlook.Inspector
            objOutlook = New Outlook.Application()
            myInspector = objOutlook.ActiveInspector

            'Show only if TypeName is nothing (Outlook Main Window)
            If TypeName(myInspector) = "Nothing" Then
                Return True
                Return False
            End If

        Catch ex As Exception
            MsgBox(ex.Message, vbCritical)
            Return False
        End Try
    End Function