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中做得更聪明,更快和更好。

