Outlook: Creating Toolbar Buttons for Specific Views


Can I define buttons on toolbars for easy access to specific views? I find the default Current View drop-down toolbar button too big and would like to replace it with a few smaller buttons for the views I use most often.

If you use Outlook 2002 or Outlook 2000, you can use some simple Outlook Visual Basic for Applications (VBA) code to create macros that you can run from toolbar buttons to apply different views. In any VBA code module, including the built-in ThisOutlookSession module, add the code that Listing 1 shows to create the ApplyView subroutine. Then, for each view that you want to put on the toolbar, create another subroutine that calls the ApplyView subroutine and passes the name of the view you want to use. The following code creates the ApplyView_Messages subroutine, which calls ApplyView and passes the name of the Messages view:

Sub ApplyView_Messages()
    Call ApplyView("Messages")
End Sub

The ApplyView_Messages subroutine is a macro that you can run from the toolbar. Simply choose View, Toolbars, Customize, then drag the macro from the Macros list on the Command tab to the toolbar. You can create an ApplyView_viewname subroutine for each view you want.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.