![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hi,
A 3rd party AV app has created a toolbar that displays permanently. But it's only useful in Mail view Is it possible to make it visible when mail view is activated and not visible in all other views (say when mail view is de-activated or any other view activated), TIA, Peter T |
#2
|
|||
|
|||
![]()
What version of Outlook?
You can get the CommandBars collection for the ActiveExplorer object and iterate that collection looking for the toolbar by name. Then you can use the Visible property of the CommandBar object to set visibility to true or false based on the ActiveExplorer.CurrentFolder.DefaultItemType property. For mail items that property would be olMailItem. -- 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, A 3rd party AV app has created a toolbar that displays permanently. But it's only useful in Mail view Is it possible to make it visible when mail view is activated and not visible in all other views (say when mail view is de-activated or any other view activated), TIA, Peter T |
#3
|
|||
|
|||
![]()
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 "Ken Slovak - [MVP - Outlook]" wrote in message ... What version of Outlook? You can get the CommandBars collection for the ActiveExplorer object and iterate that collection looking for the toolbar by name. Then you can use the Visible property of the CommandBar object to set visibility to true or false based on the ActiveExplorer.CurrentFolder.DefaultItemType property. For mail items that property would be olMailItem. -- 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, A 3rd party AV app has created a toolbar that displays permanently. But it's only useful in Mail view Is it possible to make it visible when mail view is activated and not visible in all other views (say when mail view is de-activated or any other view activated), TIA, Peter T |
#4
|
|||
|
|||
![]()
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 |
#5
|
|||
|
|||
![]()
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 |
#6
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hide Send/Receive button in Standard Toolbar - Outlook 2003 | Aaron Hammond | Outlook - Installation | 3 | June 5th 07 01:34 PM |
What event gets fired when i show/hide my outlook toolbar | Gautam | Outlook and VBA | 1 | July 12th 06 03:21 PM |
Programmatically show or hide folder list pane | BenL712 | Outlook and VBA | 3 | June 14th 06 04:13 PM |
Tasks and Errors box won't hide automatically | Mike W | Outlook Express | 8 | February 10th 06 03:13 PM |
how do I show the subject but hide the text of a meeting ? | debbied | Outlook - Calandaring | 0 | February 7th 06 04:07 PM |