How to automatically expand all folders when starting Outlook?
Typically, when you expand or collapse a folder in Outlook's Navigation Pane and subsequently close the program, the folder retains its expanded or collapsed state upon reopening Outlook. However, what if you want all folders to be automatically expanded every time you start Outlook? This article provides a VBA solution to achieve just that.
Automatically expand all folders when starting Outlook using VBA
Automatically expand all folders when starting Outlook using VBA
This guide will demonstrate how to use a VBA script to automatically expand all folders in the Navigation Pane each time you launch Outlook. Follow these steps to implement the VBA script:
- Press Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.
- Expand the Project 1 and Microsoft Outlook Objects in the Project pane, double click to open the ThisOutlookSession window, and then paste the below VBA code into it.
VBA: Automatically expand all folders in Outlook
- Save the code and close the Microsoft Visual Basic for Applications window.
From now on, when restarting Outlook, all folders will be automatically expanded in Outlook.
Notes:
- This VBA cannot open the collapsed search folders when restarting Outlook.
- To ensure the VBA script functions correctly, it's essential to adjust your macro settings in Outlook. Please go to File > Options > Trust Center > Trust Center Settings > Macro Settings, and select the Enable all macros option. This setting allows the VBA script to run without any restrictions.
AI Mail Assistant in Outlook: Smarter Replies, Clearer Communication (one-click magic!) FREE
Streamline your daily Outlook tasks with the AI Mail Assistant from Kutools for Outlook. This powerful tool learns from your past emails to offer intelligent and accurate responses, optimize your email content, and help you draft and refine messages effortlessly.

This feature supports:
- Smart Replies: Get responses crafted from your past conversations—tailored, precise, and ready to go.
- Enhanced Content: Automatically refine your email text for clarity and impact.
- Effortless Composition: Just provide keywords, and let AI handle the rest, with multiple writing styles.
- Intelligent Extensions: Expand your thoughts with context-aware suggestions.
- Summarization: Get concise overviews of long emails instantly.
- Global Reach: Translate your emails into any language with ease.
This feature supports:
- Smart email replies
- Optimized content
- Keyword-based drafts
- Intelligent content extension
- Email summarization
- Multi-language translation
Best of all, this feature is completely free forever! Don’t wait—download AI Mail Assistant now and enjoy!
Related Articles
Best Office Productivity Tools
Breaking News: Kutools for Outlook Launches Free Version!
Experience the all-new Kutools for Outlook with 100+ incredible features! Click to download now!
📧 Email Automation: Auto Reply (Available for POP and IMAP) / Schedule Send Emails / Auto CC/BCC by Rules When Sending Email / Auto Forward (Advanced Rules) / Auto Add Greeting / Automatically Split Multi-Recipient Emails into Individual Messages ...
📨 Email Management: Recall Emails / Block Scam Emails by Subjects and Others / Delete Duplicate Emails / Advanced Search / Consolidate Folders ...
📁 Attachments Pro: Batch Save / Batch Detach / Batch Compress / Auto Save / Auto Detach / Auto Compress ...
🌟 Interface Magic: 😊More Pretty and Cool Emojis / Remind you when important emails come / Minimize Outlook Instead of Closing ...
👍 One-click Wonders: Reply All with Attachments / Anti-Phishing Emails / 🕘Show Sender's Time Zone ...
👩🏼🤝👩🏻 Contacts & Calendar: Batch Add Contacts From Selected Emails / Split a Contact Group to Individual Groups / Remove Birthday Reminders ...
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

