TPE
Tavvafi@gmail.com |
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Sub EnableDisableButtons()
' Demonstrates a few things you can do to control button appearance/behavior
Dim MyButton As CommandBarButton
' Edit this to supply the actual names of your toolbar and button
'Set MyButton = CommandBars("ToolbarName").Controls.Item("ButtonName")
' For example, the Bold button on the Formatting toolbar
Set MyButton = CommandBars("Formatting").Controls.Item("Bold")
MyButton.Enabled = False
MsgBox "The button should now be grayed out/disabled. We'll re-enable it when you click OK."
MyButton.Enabled = True
End Sub