title: customize shorcut (right-click) menu powerpoint
body: <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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. </p>