以下是我的代码,我可以在其中打印共享日历文件夹中重复项目的数量。现在我想从用户说 SDate 和 EDate 获取日期范围,并希望检查指定日期范围之间的定期以及正常的约会项目并打印它。我的经常性项目从 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