如何在启动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 :利用先进的人工智能技术轻松处理电子邮件,包括回复、总结、优化、扩展、翻译和撰写邮件。
📧 邮件自动化:自动答复(支持 POP 和 IMAP) / 定时发送邮件 / 按规则自动抄送密送 / 自动转发(高级规则) / 自动添加问候语 / 自动将多收件人邮件拆分为单独消息 ...
📨 邮件管理:撤回邮件 / 按主题和其他条件阻止垃圾邮件 / 删除重复邮件 / 高级搜索 / 整合文件夹 ...
📁 附件增强功能:批量保存 / 批量拆离 / 批量压缩 / 自动保存 / 自动拆离 / 自动压缩 ...
🌟 界面魔法:😊更多漂亮酷炫的表情符号 / 当重要邮件到达时提醒您 / 最小化 Outlook 而不是关闭 ...
👍 一键奇效:带附件回复所有人 / 反钓鱼邮件 / 🕘显示发件人的时区 ...
👩🏼🤝👩🏻 联系人和日历:从选定的邮件中批量添加联系人 / 将联系人组拆分为单独的组 / 移除生日提醒 ...
单击即可立即解锁 Kutools for Outlook。不要再等待,现在就下载并提升您的效率!

