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
Home Tech? Work Tech? Increasingly, It's Just Tech

Paul discusses how the consumer market is influencing business technology in ways that are unprecedented. ...

Xbox 360 Sales Hit 28 Million

Microsoft on Tuesday announced that sales of its Xbox 360 video game console hit 28 million units by the end of 2008, a year that the company described as the console's "biggest ever." Microsoft also made the dubious claim that it has "expanded the ...

On Eve of Macworld, Microsoft Again Highlights 'Apple Tax'

With the economy in freefall, Microsoft this week continued its discussion of the "Apple Tax," what it says are the additional costs associated with using the Mac platform instead of a Windows-based PC. According to the company, the severity of the Apple ...


Development Whitepapers Batch Job Scheduling and .NET in 2008

Related Events Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

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.

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 © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing