L
Legacy 98055
Guest
Hi everyone!
Was trying to help out a poster,
see Topic: http://www.mrexcel.com/board/viewtopic.php?topic=4219&forum=2&7
if necc.
example 1:
Application.CommandBars("Standard").Controls _
("Print Preview").Enabled = False
Application.CommandBars.Controls
Hierarchy Summary:
Application.CommandBars.Controls
example 2:
Application.CommandBars("Worksheet Menu Bar").Controls _
("File").Controls("Print Preview").Enabled = False
Hierarchy Summary:
Application.CommandBars.Controls.Controls
This code for example 1 works fine:
Disables any control which begins with the Caption "Print"
Sub DisableCommandBarControl()
Dim cb As CommandBar
Dim bc As CommandBarControl
For Each cb In CommandBars
For Each bc In cb.Controls
If Left(bc.Caption, 5) = "Print" Then _
bc.Enabled = False
Next
Next
End Sub
But I could not for the life of me figure out the code for
example 2?
Anyway, I would like to know how to dig deeper here.
Thanks!
Tom
This message was edited by TsTom on 2002-04-10 05:52
Was trying to help out a poster,
see Topic: http://www.mrexcel.com/board/viewtopic.php?topic=4219&forum=2&7
if necc.
example 1:
Application.CommandBars("Standard").Controls _
("Print Preview").Enabled = False
Application.CommandBars.Controls
Hierarchy Summary:
Application.CommandBars.Controls
example 2:
Application.CommandBars("Worksheet Menu Bar").Controls _
("File").Controls("Print Preview").Enabled = False
Hierarchy Summary:
Application.CommandBars.Controls.Controls
This code for example 1 works fine:
Disables any control which begins with the Caption "Print"
Sub DisableCommandBarControl()
Dim cb As CommandBar
Dim bc As CommandBarControl
For Each cb In CommandBars
For Each bc In cb.Controls
If Left(bc.Caption, 5) = "Print" Then _
bc.Enabled = False
Next
Next
End Sub
But I could not for the life of me figure out the code for
example 2?
Anyway, I would like to know how to dig deeper here.
Thanks!
Tom
This message was edited by TsTom on 2002-04-10 05:52