Outlook:作為會議組織者,如何在日曆中保留已取消的會議?
在 Outlook 中,作為會議組織者,當您取消會議時,該會議將自動從日曆中刪除。在某些情況下,您可能希望將已取消的會議保留在日曆中以進行一些標記。然而,Outlook 中並沒有內建功能可以處理這項工作。本教程提供了兩個 VBA 程式碼,在取消會議的同時將其保留為約會。
用於將已取消會議複製為約會的 VBA 程式碼
以下是兩個程式碼,可以在取消會議的同時將其複製並粘貼為約會。
注意:在啟用程式碼之前,請確保這兩個選項已勾選:
啟用 Outlook,點擊 文件 > 選項,在 Outlook 選項窗口中,點擊 信任中心 標籤,然後點擊 信任中心設置,接著在信任中心窗口中,點擊 宏設置 標籤,勾選 啟用所有宏(不推薦;可能執行危險代碼) 和 將宏安全設置應用於已安裝的外掛程式 選項。點擊 確定 > 確定 關閉窗口。重新啟動 Outlook。


1. 切換到 Outlook 日曆檢視,並選擇要取消的會議。按下 Alt + F11 鍵以啟用 Microsoft Visual Basic for Applications 窗口。
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 鍵,現在所選的會議已被取消,並且出現了一個名為 已取消 & 主題 的新約會。

如果您想將會議複製並粘貼為另一個日曆中的約會,然後取消該會議,請使用以下程式碼:
程式碼:將會議複製為另一個日曆中的約會並取消它
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推出免費版本!
體驗全新的Kutools for Outlook免費版本,擁有70多項令人驚嘆的功能,永久使用!立即點擊下載!
🤖 Kutools AI :使用先進的AI技術輕鬆處理郵件,包括答覆、摘要、優化、擴展、翻譯和撰寫郵件。
📧 郵件自動化:自動回覆(適用於POP和IMAP) / 計劃發送郵件 / 發送郵件時按規則自動抄送密送 / 自動轉發(高級規則) / 自動新增問候語 / 自動將多收件人郵件拆分為個別郵件...
📨 郵件管理:撤回郵件 / 按主題和其他方式阻止詐騙郵件 / 刪除重複郵件 / 高級搜索 / 整合文件夾...
📁 附件專業版:批量保存 / 批量拆離 / 批量壓縮 / 自動保存 / 自動拆離 / 自動壓縮...
🌟 介面魔法:😊更多漂亮和酷炫的表情符号 / 當重要郵件到來時提醒您 / 最小化Outlook而不是關閉...
👍 一鍵奇蹟:帶附件全部答復 / 防止網絡釣魚郵件 / 🕘顯示發件人的時區...
👩🏼🤝👩🏻 聯絡人和日曆:從選中郵件批量新增聯絡人 / 將聯絡人組拆分為個別組 / 移除生日提醒...
立即單擊解鎖Kutools for Outlook。不要等待,立即下載並提升您的效率!

