Skip to main content

Kutools for Office — 一套工具,五種功能。完成更多工作。

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

Author Xiaoyang Last modified

當您啟動 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

最佳辦公室生產力工具

最新消息: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

🚀 一鍵下載 — 獲取全部 Office 插件

強力推薦:Kutools for Office(5合1)

一鍵下載五個安裝程式,包括 Kutools for Excel, Outlook, Word, PowerPointOffice Tab Pro 立即下載!

  • 一鍵便利:一次操作即可下載全部五套安裝包。
  • 🚀 隨時處理任何 Office 任務:安裝您需求的插件,隨時隨地。
  • 🧰 包含:Kutools for Excel / Kutools for Outlook / Kutools for Word / Office Tab Pro / Kutools for PowerPoint