Перейти к основному содержанию

Как автоматически открывать несколько окон Outlook при запуске Outlook? 

Когда вы запускаете учетную запись Outlook, окно почты открывается как обычно. Можно ли автоматически открывать другие окна Outlook, такие как окна почты, календаря, контактов и задач, одновременно с запуском Outlook?

Автоматическое открытие нескольких окон Outlook при запуске Outlook с кодом VBA


Автоматическое открытие нескольких окон Outlook при запуске Outlook с кодом VBA

Здесь я могу представить код VBA, который поможет вам открывать несколько окон Outlook, таких как окна почты, календаря, контактов и задач, сразу при запуске Outlook. Пожалуйста, сделайте так:

1. Удерживая нажатой ALT + F11 , чтобы открыть Microsoft Visual Basic для приложений окно.

2. В Microsoft Visual Basic для приложений окно, дважды щелкните Эта сессия Outlook из Проект1 (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

документ открыть несколько окон запуск 1

3. Затем продолжайте нажимать Вставить > Модули, скопируйте и вставьте приведенный ниже код в открытый пустой модуль, см. снимок экрана:

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

документ открыть несколько окон запуск 2

4. Затем сохраните и закройте коды, перезапустите Outlook, чтобы коды вступили в силу. Теперь при открытии Outlook окна почты, календаря, контактов и задач будут открываться автоматически бок о бок, см. Снимок экрана:

документ открыть несколько окон запуск 3


Лучшие инструменты для офисной работы

Kutools for Outlook - Более 100 мощных функций для улучшения вашего Outlook

🤖 Почтовый помощник с искусственным интеллектом: Мгновенные профессиональные электронные письма с помощью магии искусственного интеллекта: гениальные ответы одним щелчком мыши, идеальный тон, многоязычное владение. Преобразуйте электронную почту без особых усилий! ...

???? Автоматизация электронной почты: Нет на месте (доступно для POP и IMAP)  /  Расписание отправки писем  /  Автоматическое копирование/скрытая копия по правилам при отправке электронной почты  /  Автопересылка (расширенные правила)   /  Автоматическое добавление приветствия   /  Автоматически разделять электронные письма от нескольких получателей на отдельные сообщения ...

📨 Управление электронной почтой: Легко вспоминать электронные письма  /  Блокировка мошеннических писем от субъектов и других лиц  /  Удалить повторяющиеся электронные письма  /  Поиск  /  Объединение папок ...

📁 Вложения ProПакетное сохранение  /  Пакетное отсоединение  /  Пакетное сжатие  /  Автосохранение   /  Авто отсоединение  /  Автоматическое сжатие ...

???? Магия интерфейса: 😊Больше красивых и крутых смайлов   /  Повысьте производительность 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