none
Why I can not find "Microsoft.Outlook.Explorer",etc.? RRS feed

  • Question

  • Hi all. I have developed an add-in using outlook2007+vs2010. Why I can not find "Microsoft.Outlook.Explorer",etc. in the RibbonType property window? Thanks.

    Saturday, January 14, 2017 12:19 AM

Answers

  • You will need to use the old methods of Commandbars for the Explorer in Outlook 2007.

    Dear donky73,

    Would you please let me know how can I use Commandbars to add a button for the Explorer In Outlook2007?

    Thank you very much.

    • Marked as answer by leon1526 Saturday, January 14, 2017 9:04 AM
    Saturday, January 14, 2017 8:53 AM
  • Sure here is an example from MS.

    Private menuBar As Office.CommandBar
    Private menu As Office.CommandBarPopup
    Private menuItem1 As Office.CommandBarButton
    
    Private Sub AddMenuBar()
        ' Get the menu bar in the Explorer window.
        menuBar = Me.Application.ActiveExplorer() _
            .CommandBars.ActiveMenuBar()
        ' Verify that the menu does not exist
        ' and remove it if it does.
        Dim newMenu As Office.CommandBarPopup = _
            Me.Application.ActiveExplorer.CommandBars _
            .ActiveMenuBar.FindControl( _
            Office.MsoControlType.msoControlPopup, , _
            "Tag Cloud", True, True)
        If newMenu IsNot Nothing Then
            newMenu.Delete(True)
        End If
        ' Add a new menu.
        menu = menuBar.Controls.Add( _
            Office.MsoControlType.msoControlPopup, _
            Temporary:=False)
        If menu IsNot Nothing Then
            ' Edit the menu properties.
            menu.Caption = "Tag Cloud"
            menu.Tag = "Tag Cloud"
            ' Add a submenu to the menu and
            ' set its properties.
            menuItem1 = menu.Controls.Add( _
                Office.MsoControlType.msoControlButton, _
                Before:=1, Temporary:=True)
            With menuItem1
                .Style = Office.MsoButtonStyle _
                    .msoButtonIconAndCaption
                .Caption = "Add New Tag"
                .FaceId = 65
                .Tag = "Tag Cloud Submenu"
            End With
            ' Add an event handler to the menu item.
            AddHandler menuItem1.Click, _
                AddressOf MenuItem1_Click
            ' Display the new menu.
            menu.Visible = True
        End If
    End Sub
    As MSDN is notorious for changing links I have copied some of the code.


    • Marked as answer by leon1526 Saturday, January 14, 2017 9:32 AM
    Saturday, January 14, 2017 9:02 AM

All replies

  • Hi leon1526,

    For Outlook 2007 the Explorer window does not use the Ribbon.  Only Inspector windows do.

    From Outlook 2010 onward the Explorer Ribbon is available.

    You will need to use the old methods of Commandbars for the Explorer in Outlook 2007.

    • Proposed as answer by donky73 Saturday, January 14, 2017 9:12 AM
    Saturday, January 14, 2017 8:14 AM
  • You will need to use the old methods of Commandbars for the Explorer in Outlook 2007.

    Dear donky73,

    Would you please let me know how can I use Commandbars to add a button for the Explorer In Outlook2007?

    Thank you very much.

    • Marked as answer by leon1526 Saturday, January 14, 2017 9:04 AM
    Saturday, January 14, 2017 8:53 AM
  • Sure here is an example from MS.

    Private menuBar As Office.CommandBar
    Private menu As Office.CommandBarPopup
    Private menuItem1 As Office.CommandBarButton
    
    Private Sub AddMenuBar()
        ' Get the menu bar in the Explorer window.
        menuBar = Me.Application.ActiveExplorer() _
            .CommandBars.ActiveMenuBar()
        ' Verify that the menu does not exist
        ' and remove it if it does.
        Dim newMenu As Office.CommandBarPopup = _
            Me.Application.ActiveExplorer.CommandBars _
            .ActiveMenuBar.FindControl( _
            Office.MsoControlType.msoControlPopup, , _
            "Tag Cloud", True, True)
        If newMenu IsNot Nothing Then
            newMenu.Delete(True)
        End If
        ' Add a new menu.
        menu = menuBar.Controls.Add( _
            Office.MsoControlType.msoControlPopup, _
            Temporary:=False)
        If menu IsNot Nothing Then
            ' Edit the menu properties.
            menu.Caption = "Tag Cloud"
            menu.Tag = "Tag Cloud"
            ' Add a submenu to the menu and
            ' set its properties.
            menuItem1 = menu.Controls.Add( _
                Office.MsoControlType.msoControlButton, _
                Before:=1, Temporary:=True)
            With menuItem1
                .Style = Office.MsoButtonStyle _
                    .msoButtonIconAndCaption
                .Caption = "Add New Tag"
                .FaceId = 65
                .Tag = "Tag Cloud Submenu"
            End With
            ' Add an event handler to the menu item.
            AddHandler menuItem1.Click, _
                AddressOf MenuItem1_Click
            ' Display the new menu.
            menu.Visible = True
        End If
    End Sub
    As MSDN is notorious for changing links I have copied some of the code.


    • Marked as answer by leon1526 Saturday, January 14, 2017 9:32 AM
    Saturday, January 14, 2017 9:02 AM
  • why did you accept your own post as the answer?
    Saturday, January 14, 2017 9:12 AM
  • Thank you donky73
    Saturday, January 14, 2017 9:33 AM