Mouse Menu

  • Thread starter Thread starter Guest
  • Start date Start date
Hi
as starting point some code:
Sub Add_Item()
Dim New_Entry As Object
Set New_Entry = CommandBars("Cell").Controls.Add(Temporary:=True)
On Error Resume Next
New_Entry.Controls("My message").Delete
On Error Goto 0

With New_Entry
.Caption = "My message"
.OnAction = "Message"
End With
End Sub


Sub Message()
MsgBox "Now you code yould start"
End Sub

Sub Delete_Item()
Dim myControl As CommandBarButton
For Each myControl In CommandBars("Cell").Controls
If myControl.Caption = "My message" Then
myControl.Delete
End If
Next
End Sub
--
Regards
Frank Kabel
Frankfurt, Germany

kidd golfer said:
Can I add specific commands to the "right-click" mouse menu? Can I
add macros?
 
Frank-

I am a beginner, so where do I add the code? In the beginning of the macro
that I created?

Thanks.
 
Hi
you have to add this basic principle to your code or call these
routines from your other code
 
Back
Top