Toolbars

  • Thread starter Thread starter Wanda
  • Start date Start date
W

Wanda

Can you hide a standard toolbar through VBscript coding on
a custom form and then have the standard toolbar reappear
when the custom form is dismissed? Thanks.

Wanda
 
Yes, just find it in the CommandBars collection, set its Visible
property to False in the Item_Open event and in both Item_Write and
Item_Close set Visible to True.

In the form you would use Item.GetInspector.CommandBars to get the
CommandBars collection.
 
Hi Ken:

I have worked with this and I can not get this to work
through VBscript coding. I first need to identify that
the CommandBars equals the Standard toolbar ... but how do
I find what this Item is? Once I find out what the
Standard Toolbar is named, I need to set the property to
False in the Item_Open event through code? Thanks.

Wanda
 
Function Item_Open()
Dim oInspector
Dim oCB

On Error Resume Next

Set oInspector = Item.GetInspector
Set oCB = oInspector.CommandBars("Standard")
If Not (oCB Is Nothing) Then
oCB.Visible = False
End If

Set oCB = Nothing
Set oInspector = Nothing
End Function

Then in Item_Close and Item_Write put equivalent code that sets
oCB.Visible = True. You will need both events since depending on
circumstances one or the other might not fire.
 
Back
Top