Friday, November 9, 2007

Disable Cut & Copy from Popup menu (Excel VBA/Word VBA)

Here is a simple way to disable the Cut & Copy in the Popup menu

Sub Disable_Buttons() Dim oC1 As CommandBarSet oC1 = Application.CommandBars("CELL") oC1.Controls("Cu&t").Enabled = FalseoC1.Controls("&Copy").Enabled = FalseEnd Sub
Other menu items can also be handled similarly
To disable the Insert & Delete in the Popup menu
oC1.Controls("&Insert...").Enabled = FalseoC1.Controls("&Delete...").Enabled = False

No comments: