none
Explorer Ribbon does not show when Startup Folder not a mail folder RRS feed

  • Question

  • In Outlook, you can pick the default folder when starting.  When picking something other than a mail folder, i.e. calendar or tasks, then no Explorer Ribbon is shown, even after switching back to a mail folder.  The following 2 functions are called when starting with mail folder, but are never called if starting with calendar or tasks folder.

    MyRibbon.GetCustomUI
    MyRibbon.RibbonOnLoad

    Tuesday, December 13, 2016 6:46 PM

Answers

  • Show everything there is to show, then adjust the UI by disabling/hiding/etc. your ribbon controls appropriately.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by gbellpublic Monday, December 19, 2016 9:28 PM
    Monday, December 19, 2016 5:11 PM

All replies

  • Are you not returning the appropriate Ribbon XML if the current folder is not a mail folder?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, December 13, 2016 7:56 PM
  • Hello,

    Do you try to add a custom UI to a built-in tab in Outlook? What Ribbon XML do you have? GetCustomUI?


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Tuesday, December 13, 2016 10:42 PM
  • Hi gbellpublic,

    please show your code for the ribbon in the function.

    with only description we are not able to give you proper suggestion.

    it seems that you are able to load the ribbon when folder is mail but it will not load the ribbon if startup folder is different.

    I want to confirm with you , that when you able to load the ribbon when the startup folder is mail and then if you change the folder and again come to mail folder then ribbon is loading or not?

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 14, 2016 2:39 AM
    Moderator
  • I provide ribbons for the Explorer, and Mail Read, Task, Journal and Calendar inspectors.

    If my start up folder is Inbox (or any other mail folder), then GetCustomUI fires with ribbonID = Microsoft.Outlook.Explorer and I see my explorer ribbon.   If I open an email GetCustomUI fires with ribbonID = Microsoft.Outlook.Mail.Read  At this point everything is working as expected.

    If my start up folder is Calendar (or any NON mail folder), then GetCustomUI does not fire for explorer.  If I switch to a mail folder, GetCustomUI still does not fire for explorer.  If I open an email GetCustomUI fires with ribbonID = Microsoft.Outlook.Mail.Read, but GetCustomUI never fires for the Explorer.  That is my problem.

    GetCustomUI code follows

        Friend Function GetCustomUI(ByVal ribbonID As String) As String Implements Office.IRibbonExtensibility.GetCustomUI
            If ThisAddIn.App Is Nothing Then
                Debug.Print("GetCustomUI: missing ThisAddin.App")
                Return ""
            End If
            If ThisAddIn.ProfileDisabled Then
                Log.Warn("GetCustomUI: Profile Disabled")
                Return ""
            End If
            If _app Is Nothing Then
                Debug.Print("GetCustomUI: missing _app")
                Return ""
            End If
    
            'RibbonID indicates type of Inspector that is about to be displayed
            Dim customUI As String = ""
            Try
                Log.Info("{0} - {1}", Me.GetType().Name & ".GetCustomUI", ribbonID)
    
                If ribbonID = "Microsoft.Outlook.Explorer" Then
                    customUI = My.Resources.Ribbon_Explorer
                Else
                    'if trial expired, no inspector ribbons
                    If ThisAddIn.TrialExpired Then Return customUI
    
                    If ribbonID = "Microsoft.Outlook.Mail.Read" Or ribbonID = "Microsoft.Outlook.Post.Read" Then
    
                        customUI = My.Resources.Ribbon_Inspector_Mail
    
                    ElseIf ribbonID = "Microsoft.Outlook.Appointment" Or ribbonID = "Microsoft.Outlook.MeetingRequest.Send" Then
    
                        customUI = My.Resources.Ribbon_Inspector_Appointment
                        If customUI.Length > 0 Then customUI = UpdateDroplistWidths(customUI)
    
                    ElseIf ribbonID = "Microsoft.Outlook.Task" Then
    
                        customUI = My.Resources.Ribbon_Inspector_Task
                        If customUI.Length > 0 Then customUI = UpdateDroplistWidths(customUI)
    
                    ElseIf ribbonID = "Microsoft.Outlook.Journal" Then
    
                        customUI = My.Resources.Ribbon_Inspector_Journal
                        If customUI.Length > 0 Then customUI = UpdateDroplistWidths(customUI)
    
                    ElseIf ribbonID = "Microsoft.Outlook.Mail.Compose" Then
    
                        customUI = My.Resources.Ribbon_Inspector_NewMail
    
                    End If
                End If
            Catch ex As Exception
                Log.Err(ex)
                ThisAddIn.ReportError(ex)
            End Try
            Return customUI
        End Function
    


    Thursday, December 15, 2016 4:12 PM
  • Hi gbellpublic,

    when ribbon id is Microsoft.Outlook.Explorer.

    it will return xml for explorer ribbons, shortcut menus, and  Backstage view.

    Reference:

    Implementing the IRibbonExtensibility Interface

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 16, 2016 6:34 AM
    Moderator
  • Thank you Deepak, I looked at the Microsoft link you provided and came across this:

    • Office calls GetCustomUI during Outlook startup to load ribbon customizations for the explorers.

    If the default startup folder is a mail folder the statement above is true

    If the default startup folder is NOT a mail folder, it never calls GetCustomUI.  

    This should be very easy to verify for anyone who provides Explorer customizations in their addin.

    Friday, December 16, 2016 4:11 PM
  • Hi gbellpublic,

    did that help you to solve your issue?

    is your issue solved or still you have the issue with that?

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 19, 2016 8:53 AM
    Moderator
  • Deepak,

    After some investigation on my side what I am seeing the following events on startup:

    Mail Folder as Default folder (scenario 1)

    1) ThisAddin.CreateRibbonExtensibilityObject
    2) ThisAddin.ThisAddin_Startup
    3) MyRibbon.GetCustomUI

    Non-Mail Folder as Default folder (scenario 2)

    1) ThisAddin.CreateRibbonExtensibilityObject
    2) MyRibbon.GetCustomUI
    3) ThisAddin.ThisAddin_Startup

    Scenario 1 is what I would expect, it allows me (in ThisAddin_Startup) to get my settings that I use when determining what to show and how to show my toolbars.

    Scenario 2 kicks off GetCustomUI and starts calling all the Visible/Enabled/... handlers before I have a chance to get my settings via ThisAddin_Startup

    So I have no solution for this yet.  I tried putting GetCustomUI to sleep until ThisAddin_Startup, but they are on same thread, so not a solution.

    Monday, December 19, 2016 5:00 PM
  • Show everything there is to show, then adjust the UI by disabling/hiding/etc. your ribbon controls appropriately.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by gbellpublic Monday, December 19, 2016 9:28 PM
    Monday, December 19, 2016 5:11 PM
  • Thanks Dmitry, that did the trick.  Show everything, than at the end of my startup function I call Ribbon.Invalidate
    Monday, December 19, 2016 9:28 PM