Outlook 2010 有一个自动接受会议请求和删除已取消会议的选项,位于:文件->选项->日历->资源调度
在此选项下,会议请求将被自动接受。我不想这样。我想执行以下操作:
- 从日历中删除已取消的会议
- 从我的收件箱中删除已取消:...会议电子邮件
- 不要对会议请求做任何事情
这可能吗?
答案1
我找到答案通过搜索您要问的确切问题。
您必须使用以下源代码创建一个宏(将邮箱的名称更改为您自己的名称):
Set olResCalendar = OpenMAPIFolder("\MailboxName\Calendar")
Sub RemoveCanceledAppointments()
Dim olResCalendar As Outlook.MAPIFolder, olApptItem As Outlook.AppointmentItem, intCounter As Integer
'Change the path to the resource calendar on the next line
Set olResCalendar = OpenMAPIFolder("\MailboxName\Calendar")
For intCounter = olResCalendar.Items.Count To 1 Step -1
Set olApptItem = olResCalendar.Items(intCounter)
If Left(olApptItem.Subject, 9) = "Canceled:" Then
olApptItem.Delete
End If
Next
Set olApptItem = Nothing
Set olResCalendar = Nothing
End Sub
Function OpenMAPIFolder(szPath)
Dim app, ns, flr, szDir, i
Set flr = Nothing
Set app = CreateObject("Outlook.Application")
If Left(szPath, Len("\")) = "\" Then
szPath = Mid(szPath, Len("\") + 1)
Else
Set flr = app.ActiveExplorer.CurrentFolder
End If
While szPath <> ""
i = InStr(szPath, "\")
If i Then
szDir = Left(szPath, i - 1)
szPath = Mid(szPath, i + Len("\"))
Else
szDir = szPath
szPath = ""
End If
If IsNothing(flr) Then
Set ns = app.GetNamespace("MAPI")
Set flr = ns.Folders(szDir)
Else
Set flr = flr.Folders(szDir)
End If
Wend
Set OpenMAPIFolder = flr
End Function
Function IsNothing(Obj)
If TypeName(Obj) = "Nothing" Then
IsNothing = True
Else
IsNothing = False
End If
End Function
页面引述:
此宏将搜索资源日历并删除主题中带有“已取消:”的项目。您还必须拥有资源邮箱的适当权限才能执行此操作。此宏将删除已取消的会议,同时删除直接预订和自动接受的会议。