StartDownloadsServiceSamplesWorkshopsContact DeutschEnglish
 
Samples
General
Outlook®
 
Awarded by
Microsoft since 2005:
mvp logo
VBOffice Info
Visitors1644108
Impressions6223003
Links
Imprint
Privacy Policy
Contact
Folder: Switch the view
Author: Michael BauerHomepage
Date: 18.11.2009Accessed: 11261
  
Description

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 "Einfache Liste" (which is the German name for the "Simple List" view, you need to change the name, please). If the view doesn't exist for the current folder, nothing happens.

Public Sub SwitchView()
  Dim Bars As Office.CommandBars
  Dim Popup As Office.CommandBarPopup
  Dim Btn As Office.CommandBarButton
  Dim ViewName As String

  ViewName = "Einfache Liste"

  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 alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the ... [more]

 

Access the master category list in the blink of an eye, share your categories in a network, get a reminder service, and ... [more]

 

SAM automatically sets the sender, signature, and folder for sent items, for instance based on the recipient ... [more]

 

OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or ... [more]