Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub GetCommandBarNames()
Dim ctrl As CommandBar
For Each ctrl In Application.CommandBars
If ctrl.Visible Then
Debug.Print ctrl.Name, ctrl.Index
End If
Next
End Sub
CommandBars("standard").Visible = False æor True!
CommandBars("standard").Enabled = False æor True!
Sub DisableMenu()
CommandBars("Worksheet Menu Bar").Controls("File").Enabled = False æor True to enable
End Sub
Sub DisableSubMenu()
CommandBars("File").Controls("Properties").Enabled = False æor True to enable
End Sub
Sub Find_Disable_Commands()
Dim myControls As CommandBarControls
Dim ctl As CommandBarControl
Set myControls = CommandBars.FindControls _
(Type:=msoControlButton, ID:=21) '21 = cut
For Each ctl In myControls
ctl.Enabled = False
Next ctl
End Sub
Sub Disable_Cut_Keyboard()
Application.OnKey "^x", ""
End Sub
Sub Enable_Cut_Keyboard()
Application.OnKey "^x"
End Sub
Sub DisableCut_CtrlX()
'Note the use of .Disable rather than .Clear
CustomizationContext = NormalTemplate
FindKey(BuildKeyCode(wdKeyControl, wdKeyX)).Disable
End Sub
Sub EnableCut_CtrlX()
CustomizationContext = NormalTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyControl, wdKeyX), _
KeyCategory:=wdKeyCategoryCommand, Command:="editcut"
End Sub
CustomizationContext = ActiveDocument.AttachedTemplate
Application.CommandBars("Standard").Controls.Add _
Type:=msoControlButton, _
ID:=2522, Before:=8