View Single Post
  #2  
Old July 16th 09, 07:43 PM posted to microsoft.public.outlook.calendaring
Brian Tillman [MVP - Outlook]
external usenet poster
 
Posts: 4,874
Default counting appointments

"baggers" wrote in message
...

Hi Guys
I'm trying to count the number of appointments in a calendar using the
restrict method.
If I add "items.IncludeRecurrences = True" then the numbers returned all
equal 2147483647.

Here is a code snippet:
dateFrom = Date.Today
dateTo = CDate("2014-01-01")
strFind = "[Start] = " & DoubleQuote(Format(dateFrom, "dd MMM yyyy")) & "
AND [Start] " & DoubleQuote(Format(dateTo, "dd MMM yyyy"))
items = mapi.GetFolderFromID(sID).Items
items.Sort("[Start]")
items.IncludeRecurrences = True
restrictedItems = items.Restrict(strFind)
itemCounter = itemCounter + restrictedItems.Count

can anyone see where the problem lies?


The programming newgroup would be a better place to ask.
microsoft.public.outlook.program_vba
--
Brian Tillman [MVP-Outlook]

Ads