Skip to main content

如何在Outlook中自動轉發會議邀請給特定的人? 

Author: Xiaoyang Last Modified: 2025-05-12

在Outlook中,您可以手動使用轉發功能直接將會議邀請轉發給特定的人。但是,有時候當您接受會議時,可能需要自動將會議邀請轉發給特定的人。本文將介紹如何快速自動轉發會議邀請給某人。

使用VBA代碼在Outlook中自動轉發會議邀請給特定的人


使用VBA代碼在Outlook中自動轉發會議邀請給特定的人

這裡有一段實用的VBA代碼,可以幫助您在接受會議後自動將會議邀請轉發給特定的人,請按照以下步驟操作:

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

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

VBA代碼:自動轉發會議邀請給特定的人:

Public WithEvents ReceivedItems As Outlook.Items
Private Sub Application_Startup()
    Set ReceivedItems = Outlook.Application.Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub ReceivedItems_ItemAdd(ByVal Item As Object)
Dim xMeetingItem As MeetingItem
Dim xMeetingResponse As MeetingItem
Dim xForwardMeeting As MeetingItem
Dim xAppointmentItem As AppointmentItem
On Error Resume Next
If TypeOf Item Is MeetingItem Then
    Set xMeetingItem = Item
    Set xAppointmentItem = xMeetingItem.GetAssociatedAppointment(True)
    Set xMeetingResponse = xAppointmentItem.Respond(olMeetingAccepted, True)
    xMeetingResponse.Send
    Set xForwardMeeting = xMeetingItem.Forward
    With xForwardMeeting
        With .Recipients
            .Add "skyyang@addin88.com" 'change address to your own
            .ResolveAll
        End With
        .Send
    End With
End If
End Sub

便簽:在上述代碼中,您應將收件人地址更改為您自己的地址。

doc auto forward meeting 1

3. 然後保存代碼,並重新啟動Outlook以使代碼生效。

4. 現在,當您收到會議邀請時,會議將被自動接受,同時該會議也將立即自動轉發給您指定的特定人員。

便簽:此代碼僅適用於預設帳號。