var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Disable button on custom menu bar
What is an effective way to disable a button I have on a custom menu bar. I have replaced the toolbars/menu bars and would like to limit when my custom menu buttons can be used. Thanks for any help.
1. You need to reference the Microsoft Office library because toolbars are part of the Office library.
3. Here is an example of enabling or disabling toolbar buttons:
'~ Called by forms and reports
Public Function fnEnablePrintControl(ByVal bolLEnabled As Boolean)
Dim objCmdBar As CommandBar, objCBControl As CommandBarControl, objSubCBControl As CommandBarControl
Dim objCBControls As CommandBarControls, objCmdBars As CommandBars
If Application.CommandBars(pStrApplName).Visible = True Then
Set objCmdBar = Application.CommandBars(pStrApplName)
If bolLEnabled = True Then
objCmdBar.Controls("&Database").Controls("C&ascade forms").Enabled = False
objCmdBar.Controls("&Accounting").Enabled = False
objCmdBar.Controls("&Print").Enabled = True
objCmdBar.Controls("&Database").Controls("C&ascade forms").Enabled = True
objCmdBar.Controls("&Accounting").Enabled = True
objCmdBar.Controls("&Print").Enabled = False
P.S: There are variable declarations that do not belong to this procedure. Remove them as you will.
Thank you for the help. I appreciate it.