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
"Ken Slovak - [MVP - Outlook]" wrote in message
...
To detect when a folder is switched in the Explorer you'd use the
Explorer.BeforeFolderSwitch() event. That passes you NewFolder As Object,
where NewFolder is the folder being switched to.
--
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
...
Hi Ken,
Outlook 2003 (sorry I should have said)
I've got this far
Dim cb As CommandBar
Set cb = Application.ActiveExplorer.CommandBars("ESET Smart Security")
Does changing the current folder trigger some event in which the visible
property of the commandbar can be changed, or is there some other way to
do it.
Regards,
Peter T