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,超過100項精彩功能!立即下載!
🤖 Kutools AI :採用先進的AI技術輕鬆處理郵件,包括答覆、摘要、優化、擴充、翻譯及撰寫郵件。
📧 郵件自動化:自動回覆(支援POP及IMAP) / 排程發送郵件 / 發送郵件時根據規則自動抄送密送 / 自動轉發(高級規則) / 自動添加問候語 / 自動分割多收件人郵件為個別郵件 ...
📨 郵件管理:撤回郵件 / 根據主題等方式阻止詐騙郵件 / 刪除重複郵件 / 高級搜索 / 整合文件夾 ...
📁 附件專業工具:批量保存 / 批量拆離 / 批量壓縮 / 自動保存 / 自動拆離 / 自動壓縮 ...
🌟 介面魔法:😊更多精美與酷炫表情符號 /重要郵件來臨時提醒 / 最小化 Outlook 而非關閉 ...
👍 一鍵便利:帶附件全部答復 / 防詐騙郵件 / 🕘顯示發件人時區 ...
👩🏼🤝👩🏻 聯絡人與日曆:從選中郵件批量添加聯絡人 / 分割聯絡人組為個別組 / 移除生日提醒 ...
以您偏好的語言使用 Kutools,支援英語、西班牙語、德語、法語、中文及超過40種其他語言!
只需點擊一次,即可立即解鎖 Kutools for Outlook。別等了,現在下載提升您的工作效率!


🚀 一鍵下載 — 獲取全部 Office 插件
強力推薦:Kutools for Office(5合1)
一鍵下載五個安裝程式,包括 Kutools for Excel, Outlook, Word, PowerPoint及 Office Tab Pro。 立即下載!
- ✅ 一鍵便利:一次操作即可下載全部五套安裝包。
- 🚀 隨時處理任何 Office 任務:安裝您需求的插件,隨時隨地。
- 🧰 包含:Kutools for Excel / Kutools for Outlook / Kutools for Word / Office Tab Pro / Kutools for PowerPoint