Hi,
Just getting into custom menu's, They work well but would quite like to ideally grey out or hide menu options that should not be available depending on where the focus is.
I can of course test & stop if running but prefer its not obvious to use from the drop down menu itself.
CUrrently
Dim EPForm As Form
Dim NewMenu As Object
Dim NewClick As Object
On Error Resume Next
CommandBars("customsm").Delete
Set NewMenu = CommandBars.Add("customsm", 5, False, True)
NewMenu.Controls.Add 1, 19, , , True ' copy
NewMenu.Controls.Add 1, 22, , , True ' paste
Set NewClick = NewMenu.Controls.Add(1)
NewClick.begingroup = True
NewClick.Caption = "Copy Dates For Email"
NewClick.onaction = "=CopyDatesForEmail('DummyArg')"
Set NewClick = NewMenu.Controls.Add(1)
NewClick.Caption = "Change BOOKED Dates to above"
NewClick.onaction = "=ChangeDogsBookedDates('DummyArg')"
It is one or the other of my custom procedures I would like to hide
Thanks I/A
Just getting into custom menu's, They work well but would quite like to ideally grey out or hide menu options that should not be available depending on where the focus is.
I can of course test & stop if running but prefer its not obvious to use from the drop down menu itself.
CUrrently
Dim EPForm As Form
Dim NewMenu As Object
Dim NewClick As Object
On Error Resume Next
CommandBars("customsm").Delete
Set NewMenu = CommandBars.Add("customsm", 5, False, True)
NewMenu.Controls.Add 1, 19, , , True ' copy
NewMenu.Controls.Add 1, 22, , , True ' paste
Set NewClick = NewMenu.Controls.Add(1)
NewClick.begingroup = True
NewClick.Caption = "Copy Dates For Email"
NewClick.onaction = "=CopyDatesForEmail('DummyArg')"
Set NewClick = NewMenu.Controls.Add(1)
NewClick.Caption = "Change BOOKED Dates to above"
NewClick.onaction = "=ChangeDogsBookedDates('DummyArg')"
It is one or the other of my custom procedures I would like to hide
Thanks I/A