Hi,
I was just wondering how, using the Google Calendar DLL, I would be
able to use a Calendar Query object to retrieve all events prior to two
weeks from to until two months in the future, e.g:
Imports Google.GData.Calendar
Imports Google.GData.Client
...
Dim gQuery As New Google.GData.Calendar.EventQuery
Dim gService As New Google.GData.Calendar.CalendarService
...
gQuery.StartDate = Date.Now.AddDays(-14)
gQuery.EndDate = Date.Now.AddMonths(2)
...
Dim calFeed As Google.GData.Calendar.EventFeed
Try
calFeed = gService.Query(gQuery)
If calFeed.TotalResults = 0 Then
MsgBox("No results :-(")
myEvent = Nothing
gQuery = Nothing
gService = Nothing
Exit Sub
End If
For s = 1 To calFeed.TotalResults
...
My problem is that whenever I execute the code above, the
"TotalResults" is always 0 - it doesn't appear to be retrieving any
information from my calendar.
However when I use the following lines to set the date, it works:
gQuery.StartTime = Date.Now.AddDays(1)
gQuery.EndTime = Date.Now.AddMonths(2)
I cannot set StartTime to Date.Now.AddSeconds(1) or for that matter any
other value less then Date.Now.AddDays(1) - which means I cannot
retrieve past events. This query object also seems to disregard the
'StartDate' and 'EndDate' properties...
Any ideas? Can anybody shed a bit of light on this unintuitive mystery?
Thanks,
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Google
Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---