跳到主要内容

Outlook启动时如何自动打开多个Outlook窗口? 

当您启动Outlook帐户时,将正常打开“邮件”窗口。 Outlook启动时是否可以同时自动打开其他Outlook窗口,例如“邮件”,“日历”,“联系人”和“任务”窗口?

当Outlook以VBA代码开头时,会自动打开多个Outlook窗口


当Outlook以VBA代码开头时,会自动打开多个Outlook窗口

在这里,我可以介绍一个VBA代码,以帮助您在启动Outlook时立即打开多个Outlook窗口,例如“邮件”,“日历”,“联系人”和“任务”窗口。 请这样做:

1. 按住 ALT + F11 键打开 Microsoft Visual Basic应用程序 窗口。

2。 在 Microsoft Visual Basic应用程序 窗口,双击 本次展望会议 来自 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打开多个Windows启动1

3. 然后继续点击 插页 > 模块,将以下代码复制并粘贴到打开的空白模块中,请参见屏幕截图:

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

doc打开多个Windows启动2

4。 然后保存并关闭代码,重新启动Outlook以使代码生效。 现在,当打开Outlook时,“邮件”,“日历”,“联系人”和“任务”窗口将自动并排打开,请参见屏幕截图:

doc打开多个Windows启动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