跳到主要内容

Outlook:如何作为组织者在日历中保留取消会议?

在 Outlook 中,作为会议组织者,当您取消会议时,该会议将自动从日历中删除。 在某些情况下,您可能希望将取消的会议保留在日历中以做一些标记。 但是,Outlook 中没有可以处理此工作的内置功能。 在本教程中,它提供了两个 VBA 代码,用于在取消时将会议保留为约会。

将取消的会议复制为约会的 VBA 代码


将取消的会议复制为约会的 VBA 代码

这里有两个代码,用于取消会议并同时将其复制并粘贴为约会。

注意:在启用代码之前,请确保选中这两个选项:

启用Outlook,单击 文件 > 附加选项, 在 Outlook 选项窗口中,单击 信任中心 选项卡,然后单击 信任中心设置,然后在“信任中心”窗口中,单击 宏设置 选项卡,检查 启用所有宏(不推荐;有潜在危险的代码可以运行) 将宏安全设置应用于已安装的加载项 选项。 点击 OK > OK 关闭窗户。 重新启动 展望。

文档在日历 1 中保持会议

文档在日历 2 中保持会议

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 中保持会议

3。 点击 运行 按钮或按下 F5 键,现在选定的会议已被取消,并且有一个名为 Cancled & subjet 的新约会。

文档在日历 4 中保持会议

如果您想将会议复制并粘贴为另一个日历中的约会,然后取消会议,请使用以下代码:

代码:将会议复制为另一个日历中的约会并取消它

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 键,会弹出一个选择文件夹对话框,让您选择一个日历文件夹来粘贴约会,然后单击确定。

文档在日历 5 中保持会议

现在会议已取消并作为约会复制并粘贴到您选择的日历文件夹中。

文档在日历 6 中保持会议


最佳办公生产力工具

Kutools for Outlook - 超过 100 种强大功能可增强您的 Outlook

🤖 人工智能邮件助手: 具有人工智能魔力的即时专业电子邮件——一键天才回复、完美语气、多语言掌握。轻松改变电子邮件! ...

📧 电子邮件自动化: 外出(适用于 POP 和 IMAP)  /  安排发送电子邮件  /  发送电子邮件时按规则自动抄送/密件抄送  /  自动转发(高级规则)   /  自动添加问候语   /  自动将多收件人电子邮件拆分为单独的消息 ...

📨 电子邮件管理: 轻松回忆电子邮件  /  按主题和其他人阻止诈骗电子邮件  /  删除重复的电子邮件  /  高级搜索  /  合并文件夹 ...

📁 附件专业版批量保存  /  批量分离  /  批量压缩  /  自动保存   /  自动分离  /  自动压缩 ...

🌟 界面魔法: 😊更多又漂亮又酷的表情符号   /  使用选项卡式视图提高 Outlook 工作效率  /  最小化 Outlook 而不是关闭 ...

👍 一键奇迹: 使用传入附件回复全部  /   反网络钓鱼电子邮件  /  🕘显示发件人的时区 ...

👩🏼‍🤝‍👩🏻 通讯录和日历: 从选定的电子邮件中批量添加联系人  /  将联系人组拆分为各个组  /  删除生日提醒 ...

超过 100特点 等待您的探索! 单击此处了解更多。

了解更多       免费下载      购买
 

 

Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations