Iban Arriola
Iban Arriola

Reputation: 2776

customize shorcut (right-click) menu powerpoint

I want to make appear a new element on the shortcut menu, known also as right-click menu. I want this element to execute a macro that I made. I check on the web but I could find a solution that really work. I put here which one I tried:

Public Sub customizeRightClick()
    Dim pic As IPictureDisp
    Set pic = LoadPicture("C:\path\pic.jpg")
    For Each oCmdBar In Application.CommandBars
        If oCmdBar.Type = msoBarTypePopup Then
            If oCmdBar.Name = "Shapes" Then
                Set cmdButton = oCmdBar.Controls.Add(Type:=msoControlButton)
                    With cmdButton
                        .Caption = "Edit Element"
                        .Tag = "Edit"
                        .Picture = pic       'Object of type IPictureDisp
                        .OnAction = "editMag"
                    End With
            End If
        End If
    Next
End Sub

I check in the Watches and it add the control but when I use right-click on a shape the options doesn't appear. Maybe I am not putting where it have to be but I cannot find anywhere an explanation about where is the correct place to set the new element.

Upvotes: 4

Views: 2320

Answers (2)

Steve Rindsberg
Steve Rindsberg

Reputation: 14809

David's correct re 2007, but it seems they've added the ability to customize context menus back in PPT 2010:

http://social.msdn.microsoft.com/forums/office/en-US/c1eb22ba-6ca8-4c21-8100-62185355aa53/customize-rightclick-context-menu-in-powerpoint-2010

Upvotes: 1

David Zemens
David Zemens

Reputation: 53623

OK I have confirmed that there is:

Limited support for shortcut menu customizations in PPT 2007+ specifically. ....You cannot add any item to the shapes shortcut menu (unless it is an activex control) in PPT 2007+.

http://answers.microsoft.com/en-us/office/forum/office_2007-customize/customizing-right-click-menu/76aff9b3-9253-40cf-bd21-e1f832144ad8

You may be able to do this with Ribbon/XML interface, but again it may be subject to the annoying limitation that they put on certain context menus. It might simply not be possible to do what you want to do in this version of PowerPoint.

http://msdn.microsoft.com/en-us/library/gg469862.aspx#odc_xl_ta_CustomExcelContextMenus_AddDynamicMenu

Upvotes: 0

Related Questions