View Single Post
  #6  
Old November 4th 08, 06:55 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default automatically show/hide toolbar

Other custom toolbars do exactly what you're doing, except they usually do
it in a COM addin and not the Outlook VBA project. Outlook does the same
thing, but it uses Extended MAPI code in C++ instead of using the Outlook
and Office object models.

Good job on a first effort.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Peter T" peter_t@discussions wrote in message
...
OK I think I've got it (this is 1st time I've ever opened Outlook's VBE)


' ThisOutlookSession

Dim c As clsExplorer

Private Sub Application_Startup()
Set c = New clsExplorer
Set c.exp = Application.ActiveExplorer

End Sub


' code in clsExplorer

Public WithEvents exp As Explorer

Private Sub exp_BeforeFolderSwitch(ByVal NewFolder As Object, Cancel As
Boolean)
Dim bVis As Boolean
Dim cb As CommandBar

On Error GoTo errH
Set cb = Application.ActiveExplorer.CommandBars("ESET Smart Security")
bVis = NewFolder.DefaultItemType = olMailItem
cb.Visible = bVis
errH:
End Sub


Just curiosity, how do other toolbars toggle visibility depending on the
current view. IOW wondering if perhaps there is some way of associating a
custom toolbar with a particular view and avoiding VBA.

Thanks again,
Peter T


Ads