Toolbars

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 
W

Wanda

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top