Skip to main content

如何在啟動 Outlook 時自動打開多個 Outlook 窗口?

Author: Xiaoyang Last Modified: 2025-08-06

當您啟動 Outlook 帳號時,郵件窗口會正常打開。是否可以在啟動 Outlook 的同時自動打開其他 Outlook 窗口,例如郵件、日曆、聯絡人和任務窗口呢?

使用 VBA 代碼在啟動 Outlook 時自動打開多個 Outlook 窗口


使用 VBA 代碼在啟動 Outlook 時自動打開多個 Outlook 窗口

在此,我可以介紹一段 VBA 代碼,幫助您在啟動 Outlook 時立即打開多個 Outlook 窗口,例如郵件、日曆、聯絡人和任務窗口。請按照以下步驟操作:

1. 按住 ALT + F11 鍵以打開 Microsoft Visual Basic for Applications 窗口。

2. 在 Microsoft Visual Basic for Applications 窗口中,雙擊 Project1(VbaProject.OTM) 窗格中的 ThisOutlookSession 以打開模組,然後將以下代碼複製並粘貼到空白模組中。

VBA 代碼:在啟動 Outlook 時自動打開多個 Outlook 窗口:

Private Sub Application_Startup()
Dim xCalendar As Folder
Dim xTasks As Folder
Dim xContacts As Folder
Dim xInbox As Folder
Dim xExplorer As Outlook.Explorer
Dim xWidth, xHeight As Integer
On Error Resume Next
xWidth = Int(GetSystemMetrics32(0) / 4) + 60
xHeight = GetSystemMetrics32(1)
Set xInbox = Outlook.Application.ActiveExplorer.CurrentFolder
xInbox.Display
Set Application.ActiveExplorer.CurrentFolder = xInbox
Set xExplorer = Application.ActiveExplorer
With xExplorer
    .WindowState = olNormalWindow
    .Top = 0
    .Left = 0
    .Height = xHeight
    .Width = xWidth
End With
Set xCalendar = Outlook.Session.GetDefaultFolder(olFolderCalendar)
xCalendar.Display
Set xExplorer = Application.ActiveExplorer
With xExplorer
    .WindowState = olNormalWindow
    .Top = 0
   .Left = xWidth
    .Height = xHeight
    .Width = xWidth
End With
Set xContacts = Outlook.Session.GetDefaultFolder(olFolderContacts)
xContacts.Display
Set xExplorer = Application.ActiveExplorer
With xExplorer
    .WindowState = olNormalWindow
    .Top = 0
    .Left = xWidth * 2
    .Height = xHeight
    .Width = xWidth
End With
Set xTasks = Outlook.Session.GetDefaultFolder(olFolderTasks)
xTasks.Display
Set xExplorer = Application.ActiveExplorer
With xExplorer
    .WindowState = olNormalWindow
    .Top = 0
    .Left = xWidth * 3
    .Height = xHeight
    .Width = xWidth
End With
End Sub
doc open multiple windows startup 1

3. 接著繼續點擊 插入 > 模組,將以下代碼複製並粘貼到打開的空白模組中,參見截圖:

Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" (ByVal xIndex As Long) As Long
doc open multiple windows startup 2

4. 然後保存並關閉代碼,重新啟動 Outlook 以使代碼生效。現在,當打開 Outlook 時,郵件、日曆、聯絡人和任務窗口將會自動並排打開,參見截圖:

doc open multiple windows startup 3

最佳 Office 生產力工具

最新消息:Kutools for Outlook 推出免費版本!

體驗全新 Kutools for Outlook,擁有100+ 強大功能!立即下載!

🤖 Kutools AI 運用先進 AI 技術,輕鬆處理郵件,包括答覆、摘要、優化、擴寫、翻譯與撰寫郵件。

📧 郵件自動化自動回覆(支援 POP 和 IMAP) / 計劃發送郵件 / 發送郵件時根據規則自動抄送密送 / 自動轉發(高級規則) / 自動新增問候語 / 自動將多收件人郵件分割為個別郵件 ...

📨 郵件管理撤回郵件 /依主題等條件阻擋詐騙郵件 / 刪除重複郵件 / 高級搜索 / 整合文件夾 ...

📁 附件專業版批次保存 / 批次拆離 / 批次壓縮 / 自動保存 / 自動拆離 / 自動壓縮 ...

🌟 介面魔法😊更多精美酷炫表情符號 /重要郵件來臨提醒 / 最小化 Outlook 而非關閉 ...

👍 一鍵神技帶附件全部答復 /反釣魚郵件 / 🕘顯示發件人時區 ...

👩🏼‍🤝‍👩🏻 聯絡人與日曆批次從選中郵件新增聯絡人 / 將聯絡人組分割為多個組 / 移除生日提醒 ...

以您偏好的語言使用 Kutools —— 支援英語、西班牙語、德語、法語、中文及40 多種其他語言!

只需一鍵即可立即啟用 Kutools for Outlook。立即下載,提升您的效率!

kutools for outlook features1 kutools for outlook features2