跳到主要內容

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

當您啟動Outlook帳戶時,將正常打開“郵件”窗口。 Outlook啟動時是否可以同時自動打開其他Outlook窗口,例如“郵件”,“日曆”,“聯繫人”和“任務”窗口?

當Outlook以VBA代碼開頭時,會自動打開多個Outlook窗口


當Outlook以VBA代碼開頭時,會自動打開多個Outlook窗口

在這裡,我可以介紹一個VBA代碼,以幫助您在啟動Outlook時立即打開多個Outlook窗口,例如“郵件”,“日曆”,“聯繫人”和“任務”窗口。 請這樣做:

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

2。 在 Microsoft Visual Basic for Applications 窗口,雙擊 本次展望會議 來自 Project1(VbaProject.OTM) 窗格以打開模塊,然後將以下代碼複製並粘貼到空白模塊中。

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開啟多個視窗啟動1

3. 然後繼續點擊 插入 > 模塊,將以下代碼複製並粘貼到打開的空白模塊中,請參見屏幕截圖:

Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" (ByVal xIndex As Long) As Long

doc開啟多個視窗啟動2

4。 然後儲存並關閉程式碼,重新啟動Outlook即可使程式碼生效。 現在,當打開 Outlook 時,郵件、日曆、聯絡人和任務視窗將自動並排打開,請參閱螢幕截圖:

doc開啟多個視窗啟動3


最佳辦公生產力工具

Kutools for Outlook - 超過 100 種強大的功能可增強您的 Outlook

🤖 人工智慧郵件助手: 具備人工智慧魔力的即時專業電子郵件——一鍵天才回覆、完美語調、多語言掌握。輕鬆改變電子郵件! ……

📧 電子郵件自動化: 外出(適用於 POP 和 IMAP)  /  安排發送電子郵件  /  發送電子郵件時按規則自動抄送/密件副本  /  自動轉送(進階規則)   /  自動添加問候語   /  自動將多收件者電子郵件拆分為單獨的訊息 ...

📨 電子郵件管理: 輕鬆回憶電子郵件  /  按主題和其他人阻止詐騙電子郵件  /  刪除重複的電子郵件  /  進階搜索  /  合併資料夾 ...

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

🌟 介面魔法: 😊更多又漂亮又酷的表情符號   /  使用選項卡式視圖提高 Outlook 工作效率  /  最小化 Outlook 而不是關閉 ...

👍 一鍵奇蹟: 使用傳入附件回覆全部  /   反網路釣魚電子郵件  /  🕘顯示寄件者的時區 ...

👩🏼‍🤝‍👩🏻 通訊錄和行事曆: 從選定的電子郵件中大量新增聯絡人  /  將聯絡人群組拆分為各組  /  刪除生日提醒 ...

超過 100特點 等待您的探索! 按此處了解更多。

閱讀更多       免費下載      購買
 

 

Comments (6)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hola me sale este error, que hago?
This comment was minimized by the moderator on the site
El codigo de este proyecto se debe actualizar para usarse en sistemas de 64 bits. Revise y actualice las instrucciones Declare y, a continuación, márquelas con el atributo PtrSafe
This comment was minimized by the moderator on the site
ya pude solucionar el tema de PtrSafe, ahora me marca que no se ha definido Sub o Function; señalando en amarillo Private Sub Application_Startup() y señalando en azul GetSystemMetrics32, ahora si no me deja correr la macro, que hago?
This comment was minimized by the moderator on the site
Ya pude resolver el tema de arriba, ahora solo quiero las ventanas de inbox y task se abran de la siguinete manera (eliminando del codigo las ventanas calendario y contactos).


Task en mi pantalla secundaria (me gustaría saber como definir la posición de la pantalla que lo quiero y los pixeles) y el inbox en pantalla completa en mi monitor principal, me pueden ayudar?

Saludos!
This comment was minimized by the moderator on the site
Is there a way to make this open the windows in separate screens? I have 3 screens at my work, and I want to have my inbox open on screen 3, calendar to open on screen 2, and the tasks to open on screen 1, all maximised. Not fussed about the contacts page. Any advice on how to alter that would be appreciated. Currently they all open on the one screen, inbox maximised and calendar/tasks in smaller windows.
This comment was minimized by the moderator on the site
Hello, Chris,
May be the following VBA code can help you to solve your problem. Please try it.

Private Declare PtrSafe Function GetSystemMetrics32 Lib "User32" Alias "GetSystemMetrics" (ByVal xIndex As Long) As Long
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 As Integer, xHeight As Integer
On Error Resume Next
xWidth = GetSystemMetrics32(0)
xHeight = GetSystemMetrics32(1)
Set xInbox = Outlook.Application.Session.GetDefaultFolder(olFolderInbox)
Set Outlook.Application.ActiveExplorer.CurrentFolder = xInbox
Set xExplorer = Application.ActiveExplorer
ExplorerDisplay xExplorer, 0
Set xCalendar = Outlook.Session.GetDefaultFolder(olFolderCalendar)
xCalendar.Display
Set xExplorer = Application.ActiveExplorer
ExplorerDisplay xExplorer, xWidth
Set xTasks = Outlook.Session.GetDefaultFolder(olFolderTasks)
xTasks.Display
Set xExplorer = Application.ActiveExplorer
ExplorerDisplay xExplorer, (xExplorer.Width + 1) * -1
End Sub

Sub ExplorerDisplay(Exp As Explorer, ByVal L As Integer)
With Exp
.WindowState = olNormalWindow
.Top = 0
.Left = L
.WindowState = olMaximized
End With
End Sub
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations