
![]() |
Reporter |
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month. |
You can comfortably switch the current view via View/Current View. But of course, you can do that also with VBA as this example demonstrates: For the current folder the view is switched to "Simple List". If the view doesn't exist for the current folder, nothing happens.
(The sample works for up to Outlook 2010.)
Public Sub SwitchView() Dim Bars As Office.CommandBars Dim Popup As Office.CommandBarPopup Dim Btn As Office.CommandBarButton Dim ViewName As String ViewName = "Simple List" ViewName = LCase$(ViewName) Set Bars = Application.ActiveExplorer.CommandBars Set Popup = Bars.FindControl(, 30124) If Not Popup Is Nothing Then For Each Btn In Popup.Controls If LCase$(Btn.Caption) = ViewName Then Btn.Execute Exit For End If Next End If End Sub
![]() |
ReplyAll |
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail. |