如何在啟動 Outlook 時自動打開多個 Outlook 窗口?
當您啟動 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

3. 接著繼續點擊 插入 > 模組,將以下代碼複製並粘貼到打開的空白模組中,參見截圖:
Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" (ByVal xIndex As Long) As Long

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

最佳辦公室生產力工具
最新消息:Kutools for Outlook推出免費版本!
體驗全新的Kutools for Outlook免費版本,擁有70多項令人驚嘆的功能,永久使用!立即點擊下載!
🤖 Kutools AI :使用先進的AI技術輕鬆處理郵件,包括答覆、摘要、優化、擴展、翻譯和撰寫郵件。
📧 郵件自動化:自動回覆(適用於POP和IMAP) / 計劃發送郵件 / 發送郵件時按規則自動抄送密送 / 自動轉發(高級規則) / 自動新增問候語 / 自動將多收件人郵件拆分為個別郵件...
📨 郵件管理:撤回郵件 / 按主題和其他方式阻止詐騙郵件 / 刪除重複郵件 / 高級搜索 / 整合文件夾...
📁 附件專業版:批量保存 / 批量拆離 / 批量壓縮 / 自動保存 / 自動拆離 / 自動壓縮...
🌟 介面魔法:😊更多漂亮和酷炫的表情符号 / 當重要郵件到來時提醒您 / 最小化Outlook而不是關閉...
👍 一鍵奇蹟:帶附件全部答復 / 防止網絡釣魚郵件 / 🕘顯示發件人的時區...
👩🏼🤝👩🏻 聯絡人和日曆:從選中郵件批量新增聯絡人 / 將聯絡人組拆分為個別組 / 移除生日提醒...
立即單擊解鎖Kutools for Outlook。不要等待,立即下載並提升您的效率!

