以下是我的代码,我可以在其中打印共享日历文件夹中的重复项目数。现在我想从用户说出SDate和EDate的日期范围,并想要检查指定日期范围之间的重复以及正常的aapointment项目并打印它。我的定期项目从2010年1月1日开始,它没有结束,它每周五都会重复。我想检查特定项目是否在我的日期范围之间重复,如果是,则要打印其详细信息。
Sub item()
Dim objExpCal As Outlook.Explorer
Dim objNavMod As Outlook.CalendarModule
Dim objNavGroup As Outlook.NavigationGroup
Dim objNavFolder As Outlook.NavigationFolder
Dim objFolder As Outlook.Folder
Set objOL = Application
Set objNS = objOL.Session
Set colExpl = objOL.Explorers
Set objExpCal = _
objNS.GetDefaultFolder(olFolderCalendar).GetExplorer
Set objNavMod = objExpCal.NavigationPane.Modules. _
GetNavigationModule(olModuleCalendar)
Set objNavGroup = objNavMod.NavigationGroups. _
GetDefaultNavigationGroup(olPeopleFoldersGroup)
For Each objNavFolder In objNavGroup.NavigationFolders
Set objFolder = objNavFolder.Folder
Set oItems = objFolder.Items
Set colFilteredItems = oItems.Restrict("[IsRecurring] = TRUE")
For Each objItem In colFilteredItems
Debug.Print objItem
Set objpattern = objItem.GetRecurrencePattern
Next
Next
End Sub
答案 0 :(得分:0)
使用Items.IncludeRecurrences属性: http://msdn.microsoft.com/en-us/library/office/aa171434(v=office.11).aspx