• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Open multiple Outlook windows when Outlook starts

Slipstick Systems

› Developer › Open multiple Outlook windows when Outlook starts

Last reviewed on April 6, 2018     12 Comments

An Outlook user wants to open his Calendar, Contacts, Tasks, and Inbox in a specific order and with specific window sizes when he opens Outlook.

Is it possible to automatically open up four Outlook windows in a particular order (mail, calendar, contacts and tasks) and size?

While you can use the instructions at How to Open Multiple Outlook Windows to open multiple windows when you start Outlook, you don't have a lot of control over the order the windows open or their size. If you close some windows before exiting Outlook, you'll need to re-open those windows.

But with VBA almost anything is possible.

This startup macro will open the windows in the order listed when Outlook starts up. Each window can have a unique size and position. When the macro is finished, the Inbox is brought into focus and maximized.

Tip: to get the window size and position, adjust the windows on screen and take a screenshot. Use Snagit or another image editor to find the position (in pixels) of the upper left corner of each window and the window size. (Or use an on-screen ruler.)

As written, this macro assumes you have Outlook starting up in the Inbox (in File, Options, Advanced) and want it maximized. If you start up in a different folder, adjust the object names as needed.

Private Sub Application_Startup()

Dim objCalendar As Folder
Dim objTasks As Folder
Dim objContacts As Folder
Dim objInbox As Folder
Dim olExp As Outlook.Explorer

Set objInbox = Application.ActiveExplorer.CurrentFolder

Set objCalendar = Session.GetDefaultFolder(olFolderCalendar)
Set objContacts = Session.GetDefaultFolder(olFolderContacts)
Set objTasks = Session.GetDefaultFolder(olFolderTasks)
'Set objInbox = Session.GetDefaultFolder(olFolderInbox)

objTasks.Display
Set olExp = Application.ActiveExplorer

With olExp
    .WindowState = olMinimized
End With

objCalendar.Display
Set olExp = Application.ActiveExplorer
With olExp
    .WindowState = olNormalWindow
    .Top = 0
    .Left = 0
    .Height = 1200
    .Width = 800
End With

objContacts.Display
Set olExp = Application.ActiveExplorer
With olExp
    .WindowState = olNormalWindow
    .Top = 0
    .Left = 800
    .Height = 1200
    .Width = 800
End With

objInbox.Display
Set Application.ActiveExplorer.CurrentFolder = objInbox
' olMaximized
Set olExp = Application.ActiveExplorer
olExp.WindowState = olMaximized

End Sub

NameEnumerationDescription
olMaximized0The window is maximized.
olMinimized1The window is minimized.
olNormalWindow2A "normal" window open on screen. It's not minimized or maximized.

This snippet opens the windows then offsets each window from the previous window, with the Inbox on top.

objTasks.Display
objCalendar.Display
objContacts.Display

Dim olExps As Outlook.Explorers
Set olExps = Application.Explorers

Dim lTop As Long, lLeft As Long
lTop = 200
lLeft = 200

For x = 1 To olExps.Count

With olExps.Item(x)
    .WindowState = olNormalWindow
    .Top = lTop
    .Left = lLeft
    .Height = 700
    .Width = 1000
End With
lTop = lTop + lTop * 0.25
lLeft = lLeft + lTop * 0.25

Next x

Set Application.ActiveExplorer.CurrentFolder = objInbox
End Sub

How to use the macros on this page

First: You need to have macro security set to the lowest setting, Enable all macros during testing. The macros will not work with the top two options that disable all macros or unsigned macros. You could choose the option Notification for all macros, then accept it each time you restart Outlook, however, because it's somewhat hard to sneak macros into Outlook (unlike in Word and Excel), allowing all macros is safe, especially during the testing phase. You can sign the macro when it is finished and change the macro security to notify.

To check your macro security in Outlook 2010 and newer, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, look at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Macros that run when Outlook starts or automatically need to be in ThisOutlookSession.

The macros on this page need to go into ThisOutlookSession.

Open the VBA Editor by pressing Alt+F11 on your keyboard.

To put the macro code in ThisOutlookSession:

  1. Expand Project1 and double click on ThisOutlookSession.
  2. Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)

More information as well as screenshots are at How to use the VBA Editor

Open multiple Outlook windows when Outlook starts was last modified: April 6th, 2018 by Diane Poremsky

Related Posts:

  • Shortcuts to open Outlook folders
  • How to Open Multiple Outlook Windows
  • Use PowerShell or VBA to get Outlook folder creation date
  • Move Outlook Folders using VBA

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
12 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

asdasdsd
February 25, 2023 12:08 am

Private Sub Application_Startup()
This works only when changing it to
Public Sub Application_Startup()

0
0
Reply
Isaac
May 16, 2022 3:57 am

Hi Diane. I have been using this incredible on open procedure for quite some time. I love it . TY! However, I see that it un-sets my calendar view in my to do pane on my tasks screen. Any way to adjust for this?
Isaac

'Private Sub Application_Startup()

'Dim objTasks As Folder
'Dim objInbox As Folder
'Dim olExp As Outlook.Explorer

'Set objInbox = Application.ActiveExplorer.CurrentFolder
'Set objTasks = Session.GetDefaultFolder(olFolderToDo)

'objTasks.Display
'Set olExp = Application.ActiveExplorer
'With olExp
'  .WindowState = olMaximized
'End With

'objInbox.Display
'Set Application.ActiveExplorer.CurrentFolder = objInbox
'Set olExp = Application.ActiveExplorer
'olExp.WindowState = olMaximized

'End Sub

0
0
Reply
Yohann
June 15, 2021 3:46 am

Hello Diane, I have shared a macro project to some colleagues (we are working with Outlook 2016). For some of them, the "Private Sub Application_Startup()" is not working. I do not understand why... I have checked on the PC of one of them, and the macros Outlook settings are good. I have tried to insert a "stop" into the code at the beginning of the procedure, relaunched Outlook, but nothing happened (the code even did not go until the "stop" point).
Do you have an idea about what could go wrong?
Thank you for your help.

Yohann

0
0
Reply
Victor
July 3, 2019 2:59 pm

I don't understand how to use the (second) snippet. I tried replacing most of Application_Startup() with the snippet. Then testing it with F8 went ok. But when starting outlook outlook crashes and when starting it the second time it has turned off VBA. "Problem" is that when creating new window and changing it to calender, it gets the calender Icon in the taskbar. That doesn't work with the Application_Startup; they all have the mail-icon. One can live with that but would be nice if there was a solution.
I use a .vbs to close outlook:

Set objOutlook = CreateObject("Outlook.Application")
objOutlook.Quit
Set objOutlook = Nothing

and included it in other batchfiles (vbs) to restart and turn off the PC; all added as links in a folder on the taskbar. This way Outlook starts in the same mode when it was "quit". However when windows crashes or other moments you don't use a batch this is forgotten. Think I will stick to that for a while.

0
0
Reply
Michelle Fournet
February 7, 2019 8:59 am

Thank you thank you thank you! This still works great for Outlook 2016. I can't tell you how much I appreciate this!

0
0
Reply
Junia
September 6, 2018 4:13 am

Hi Diane; I went back to this issue, and thought I would need to go first to Macros and CREATE a new one, which I did, calling it 'ThisOutlookSession.OpenTwoWindows'. That took me to the VBA editor, with the code of my original DeleteAttachments macro above a newly automatically inserted line after the entry 'End Sub' on that code. Under the line, there were two new sentences: 'Sub OpenTwoWindows' and 'End Sub'. I therefore copied and pasted the entire code you provided above between these two sentences, saved the newly edited VBA project, closed it, returned to Outlook and closed Outlook. When I opened Outlook again, it did what the code asked it to do - that is the good news! However, I do not want to open all 4 windows at Start-up, but only Inbox and Calendar. So, my intention was to edit the code to get rid of the other 2 windows I am not interested in. Tackling one variable at a time, the first modification I did was to remove all the entries for Tasks only, as on the attached Screenshot (I am not sure this attaching is working!... You may get multiple copies of the JPEG file… Read more »

Capture 1.JPG
0
0
Reply
Junia
September 3, 2018 12:51 am

Hi Diane; any chance of a reply, please?
Cheers.

0
0
Reply
Diane Poremsky
Author
Reply to  Junia
November 14, 2018 9:36 am

Sorry I missed your questions earlier (too many comments, not enough time :)) although late, I will try to get your questions answered today.

0
0
Reply
Junia
August 27, 2018 10:55 pm

I want to try this, as I am interested in having only 2 windows (Inbox and Calendar), automatically opening when I start Outlook. I think I know how to modify the text of the Macro you provided for my purposes.
My problem/doubt is: I already have a Macro in the Project1 (VBAProject.OTM)\Microsoft Outlook Objects\ThisOutlookSession. This is a macro called DeleteAttachment (which I got from you!) that instructs Outlook to add an entry onto the message to state that the attachment was deleted. How can I add a second Macro to the same session? Do I just copy and paste the text for the new Macro (as above, to open the two windows) at the end of the DeleteAttachment text? I imagine the answer is no, but I cannot figure out how to do it otherwise. I may be missing some very simple insight here... Thanks in advance for your invaluable help!

0
0
Reply
Diane Poremsky
Author
Reply to  Junia
November 14, 2018 9:40 am

You can have more than one macro - they can be in one module or in different modules. (I like to use different modules, just to make it easier to find them. Outlook won't have a problems find them though.)

The is one exception - macros that run automatically. You can only have one of some of the auto macros; you can have multiple of others (like itemadd) as long as the names are different.

0
0
Reply
Junia Melo
Reply to  Diane Poremsky
November 14, 2018 6:12 pm

Thanks, Diane. In the meantime, I managed to edit the second macro to do what I wanted, and appended it to the end of the old one. It was a lot of trial and error to get the windows the preferred size, and I could never get them to come up exactly as I wanted: the Inbox opening with the left Folder panel visible and 'pinned', and the Calendar window without the visible Folder panel. I still have to do the pinning and and the hiding manually every time I open Outlook. Not a big drama, but a little frustrating for being 'beaten' by the inability to get it how I wanted! So, now I have 2 questions still on this matter: 1) How do I modify the macro to get that effect? 2) I would also like to have the two macros in different modules. At present they are consecutively written in the 'ThisOutlookSession'. Is the process just one of Copying the text of the second macro and Pasting it onto an empty Module 1? If yes, can I then delete that second macro from the ThisOutlookSession? I attach a screenshot of the current setup to show you the… Read more »

Macro screenshot.JPG
0
0
Reply
Junia
Reply to  Diane Poremsky
March 19, 2019 10:03 pm

Hi Diana;
This macro, for opening multiple windows when Outlook starts, worked OK until recently. However, for the past 4 weeks or so, Outlook has repeatedly been crashing - it stops working, restarts by itself and, in doing so, it opens multiples of the multiple windows. Furthermore, it also loses my other configurations of the 'Customise' the Ribbon and the QuickAccess Toolbar. Could this be a 'late' (???) consequence of this macro, for some unknown reason? Or can you think of another reason why Outlook has become this unstable? I have tried to 'Repair' it via the Control Panel, but the problem was not solved. I also ran a MS Support and Recovery Assistant for Office 365 tool, and it did not solve it either.
My Outlook is 2016 on the Office 365 provided by my University on an Exchange server.
I look forward to hearing from you!
Junia.

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 30 Issue 32

Subscribe to Exchange Messaging Outlook






Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Jetpack plugin with Stats module needs to be enabled.
  • Move Deleted Items to Another Folder Automatically
  • Open Outlook Templates using PowerShell
  • Count and List Folders in Classic Outlook
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
  • Opening PST files in New Outlook
  • New Outlook: Show To, CC, BCC in Replies
  • Insert Word Document into Email using VBA
  • Delete Empty Folders using PowerShell
  • Warn Before Deleting a Contact
Ajax spinner

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in classic Outlook (Windows).

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




New Outlook Articles

Move Deleted Items to Another Folder Automatically

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Opening PST files in New Outlook

New Outlook: Show To, CC, BCC in Replies

Insert Word Document into Email using VBA

Delete Empty Folders using PowerShell

Warn Before Deleting a Contact

Newest Code Samples

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2025 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

:wpds_smile::wpds_grin::wpds_wink::wpds_mrgreen::wpds_neutral::wpds_twisted::wpds_arrow::wpds_shock::wpds_unamused::wpds_cool::wpds_evil::wpds_oops::wpds_razz::wpds_roll::wpds_cry::wpds_eek::wpds_lol::wpds_mad::wpds_sad::wpds_exclamation::wpds_question::wpds_idea::wpds_hmm::wpds_beg::wpds_whew::wpds_chuckle::wpds_silly::wpds_envy::wpds_shutmouth:
wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment