Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


November 2000

Opening Folders When Outlook Starts


RSS
Subscribe to Windows IT Pro | See More PST Files Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

One annoying aspect of Microsoft Outlook is that its user interface (UI) doesn't always behave consistently. For example, open the Inbox and Calendar folders in separate windows. Then, close Outlook by clicking File, Exit and Log Off. When you restart Outlook, the separate Inbox and Calendar windows reopen. Now, try the same operation with the Inbox and a Microsoft Exchange Server public folder in separate windows. When you restart Outlook, Outlook doesn't remember that the public folder was open and instead displays the Inbox folder in the extra window.

This annoyance is a prime target for an Outlook 2000 VBA routine that runs when Outlook starts. The routine depends on a shortcut group on the Outlook Bar that contains shortcuts to the folders you want to open when Outlook starts—similar to the Startup group on the Programs menu. Right-click the Outlook Bar, and choose Add New Group. Name the group Startup Folders. Add to the Startup Folders group any folders (besides the Inbox) that you want to appear when Outlook starts.

Now, add the code you see in Listing 1 to your Outlook VBA project's built-in ThisOutlookSession module. This code for the Application_Startup event handler runs the ShowMyFolders subroutine (which you see in Listing 2), then makes the most recently loaded window the active window. This window is either the Inbox or another default folder that you have set to open when Outlook starts.

Put the code in Listing 2 in the ThisOutlookSession module or in a separate module. The ShowMyFolders procedure checks for the existence of a Startup Folders group. If it finds one, it uses the TypeName() function to test whether each shortcut in the group represents a MAPIFolder object (i.e., an Outlook folder). For Web URL shortcuts on the Outlook Bar, TypeName() returns "String"; for system folder shortcuts, the function returns "Object". The code ignores any shortcuts to system folders or Web pages because Outlook doesn't provide a programmatic method to display a non-Outlook folder in an Outlook window.

You can customize Listing 2's code in two ways. First, you can control which navigation panes Outlook displays in the Explorer window. By supplying the Add method's second argument with the intrinsic constant olFolderDisplayNoNavigation, Listing 2's code sets the window to show neither the Outlook Bar nor the folder list. Other possible values are olFolderDisplayFolderOnly (i.e., show the folder list) and olFolderDisplayNormal (i.e., show the Outlook Bar).

You can also customize the state of the Explorer window. Listing 2's code minimizes the window:

objExpl.WindowState =   olMinimized

The other choices besides olMinimized are olMaximized and olNormalWindow.

After you add this code to your VBA project, whenever you start Outlook, separate windows will open for each of the Outlook folders in the Startup Folders group on the Outlook Bar. By the way, if you want Outlook to start in a default folder other than the Inbox, choose Tools, Options, then switch to the Other tab and click Advanced Options. You'll see the Startup in this folder list at the top of the dialog box.

End of Article



Reader Comments
Can you maybe help me? I would like to know how to adjust Outlook so that when opening outlook it will open automatically with inbox, without me first select inbox. With Outlook 97 it is very easy, but with 2000 I can not find out how to change it.

Regards,



F van Wensen December 17, 2003


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

More fun TechEd 2005 Resources

Kevin points out some more TechEd resources ...

What service packs and fixes are available?

...


Development Whitepapers Batch Job Scheduling and .NET in 2008

ETX Driving Embedded I/O

Database Professionals: Experience Profile and Need Gaps in Development and Database Tools

Related Events Check out our list of Free Email Newsletters!

Exchange Server and Outlook eBooks Spam Fighting and Email Security for the 21st Century

Understanding and Leveraging Code Signing Technologies

The Expert's Guide for Exchange 2003: Preparing for, Moving to, and Supporting Exchange Server 2003

Related Exchange Server and Outlook Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Exchange & Outlook UPDATE eNewsletter
News, strategies, products, and developments in Exchange Server and Outlook messaging.
Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Microsoft Exchange & Windows Connections event returns to Las Vegas Nov 10 - 13
Connections returns to Las Vegas for this exciting event where each attendee will receive SQL Server 2008 standard with 1 CAL. Co-located with Microsoft ASP.NET, SQL Server, and SharePoint Connections with over 250 in-depth sessions.

Free Online Event! Virtualization:Get the Facts!
Register now and attend this free, live in-depth online conference on November 13 and 20, 2008, produced by Windows IT Pro. All registrants are eligible to receive a complimentary one-year digital subscription to Windows IT Pro (a $49.95 value)!

Check Out Hyper-V Video on ITTV
Watch Karen Forster's interview on Hyper-V's performance on ITTV.net.

Ease Your Scripting Pains with the Flexibility of PowerShell!
Join MVP Paul Robichaux on December 11, 2008 at 11:00 AM EDT as he equips you with PowerShell basics in 3 introductory lessons, each followed by a live Q&A session—all on your own computer!

Latest Advancements in SSL Technology
There are a variety of different kinds of SSL to explore to ensure customer data is kept confidential and secure. In this paper, we will discuss some of these SSL advances to help you decide which would be best for your organization.

PASS Community Summit 2008 in Seattle on Nov 18-21
The don’t-miss event for Microsoft SQL Server Professionals. Register now and you’ll enjoy top-notch Microsoft and Community speakers and more.



Solving PST Management Problems
In this white paper, read about the top PST issues and how to administer local/network PST Files.

Get Protected -- Data Protection Manager 2007
Protect your virtualized environment with Data Protection Manager

Order Your SQL Fundamentals CD Today!
Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.

Maximize Your SharePoint Investment: Get Your Data Moving
Watch this web seminar now to learn how to maximize your SharePoint investment! Join us as we take a look at the complex business of securing, accessing and managing vast amounts of information in a global network and various ways to get your data moving.
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing