Outlook:如何作為組織者在日曆中保留取消會議?
在 Outlook 中,作為會議組織者,當您取消會議時,該會議將自動從日曆中刪除。 在某些情況下,您可能希望將取消的會議保留在日曆中以做一些標記。 但是,Outlook 中沒有可以處理此工作的內置功能。 在本教程中,它提供了兩個 VBA 代碼,用於在取消時將會議保留為約會。
將取消的會議複製為約會的 VBA 代碼
這裡有兩個代碼,用於取消會議並同時將其複制並粘貼為約會。
注意:在啟用代碼之前,請確保選中這兩個選項:
啟用Outlook,單擊 文件 > 選項, 在 Outlook 選項窗口中,單擊 信託中心 選項卡,然後單擊 信任中心設置,然後在“信任中心”窗口中,單擊 宏設置 選項卡,檢查 啟用所有的宏(不推薦;有潛在危險的代碼可以運行) 及 將宏安全設置應用於已安裝的加載項 選項。 點擊 OK > OK 關閉窗戶。 重新啟動 外表。
1. Swift 到 Outlook 日曆視圖,然後選擇要取消的會議 按 其他 + F11 鍵以啟用“ Microsoft Visual Basic應用程序”窗口。
2。 點擊 插入 > 模塊 插入一個新的空白模塊。 然後將下面的代碼複製並粘貼到其中。
代碼:將會議複製為約會並取消
Sub CopyMeetingAsAppointmentBeforeCancel()
'UpdatebyExtendoffice20221129
Dim xAppointmentItem As AppointmentItem
Dim xMeetingItem As AppointmentItem
On Error Resume Next
Set xMeetingItem = GetCurrentItem()
Set xAppointmentItem = Application.CreateItem(olAppointmentItem)
With xAppointmentItem
.Subject = "Canceled: " & xMeetingItem.Subject
.Start = xMeetingItem.Start
.Duration = xMeetingItem.Duration
.Location = xMeetingItem.Location
.Body = xMeetingItem.Body
.Save
.Move Application.ActiveExplorer.CurrentFolder
End With
With xMeetingItem
.MeetingStatus = olMeetingCanceled
.Send
.Delete
End With
Set xAppointmentItem = Nothing
Set xMeetingItem = Nothing
End Sub
Function GetCurrentItem() As Object
On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = Application.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = Application.ActiveInspector.CurrentItem
End Select
End Function
3。 點擊 跑 按鈕或按下 F5 鍵,現在選定的會議已被取消,並且有一個名為 Cancled & subjet 的新約會。
如果您想將會議複製並粘貼為另一個日曆中的約會,然後取消會議,請使用以下代碼:
代碼:將會議複製為另一個日曆中的約會並取消它
Sub CopyMeetingAsAppointmentToCalenderBeforeCancel()
'Updatebyextendoffice20221129
Dim xDestCalendar As Outlook.MAPIFolder
Dim xNameSpace As Outlook.NameSpace
Dim xAppointmentItem As AppointmentItem
Dim xMeetingItem As AppointmentItem
On Error Resume Next
Set xNameSpace = Application.GetNamespace("MAPI")
Set xDestCalendar = xNameSpace.PickFolder
If xDestCalendar.DefaultItemType <> olAppointmentItem Then
MsgBox "Please Select calendar folder. ", vbOKOnly + vbInformation, "Kutools for Outlook"
Exit Sub
End If
Set xMeetingItem = GetCurrentItem()
Set xAppointmentItem = Application.CreateItem(olAppointmentItem)
With xAppointmentItem
.Subject = "Canceled: " & xMeetingItem.Subject
.Start = xMeetingItem.Start
.Duration = xMeetingItem.Duration
.Location = xMeetingItem.Location
.Body = xMeetingItem.Body
.Save
.Move xDestCalendar
End With
With xMeetingItem
.MeetingStatus = olMeetingCanceled
.Send
.Delete
End With
Set xDestCalendar = Nothing
Set xNameSpace = Nothing
Set xAppointmentItem = Nothing
Set xMeetingItem = Nothing
End Sub
Function GetCurrentItem() As Object
On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = Application.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = Application.ActiveInspector.CurrentItem
End Select
End Function
點擊 跑 按鈕或按下 F5 鍵,會彈出一個選擇文件夾對話框,讓您選擇一個日曆文件夾來粘貼約會,然後單擊確定。
現在會議已取消並作為約會復制並粘貼到您選擇的日曆文件夾中。
Kutools for Outlook-為Outlook帶來100個高級功能,並使工作更加輕鬆!
- 自動CC / BCC 根據規則發送電子郵件; 自動前進 自定義多封電子郵件; 自動回复 沒有交換服務器,還有更多自動功能...
- BCC警告 -當您嘗試全部答复時顯示消息 如果您的郵件地址在“密件抄送”列表中; 缺少附件時提醒,還有更多提醒功能...
- 在郵件對話中回复(全部)帶有所有附件; 回复許多電子郵件 片刻之間; 自動添加問候語 回复時將日期添加到主題中...
- 附件工具:管理所有郵件中的所有附件, 自動分離, 全部壓縮,重命名全部,保存全部...快速報告, 計算選定的郵件...
- 強大的垃圾郵件 習俗 刪除重複的郵件和聯繫人... 使您能夠在Outlook中做得更聰明,更快和更好。

