到目前爲止,我可以使用以下代碼在日曆中插入事件。Google Calender Vr3 - 如何向活動添加提醒?
Dim calService As CalendarService = calendarFunctions.getCalendarService(txtrefreshToken.Text.Trim)
Dim calEventEntry As New Data.Event
calEventEntry.Summary = "Invoice #123456 Due on dd/mm/yyyy"
calEventEntry.Description = "Client: Acme Printing Ltd."
calEventEntry.Id = "inv5670010"
Dim eventStartDT As New Data.EventDateTime()
eventStartDT.DateTime = DateTime.Now.AddHours(24)
Dim eventStartEndDT As New Data.EventDateTime()
eventStartEndDT.DateTime = DateTime.Now.AddHours(25)
calEventEntry.Start = eventStartDT
calEventEntry.End = eventStartEndDT
Dim er As New EventsResource(calService)
Dim erResp As Data.Event = er.Insert(calEventEntry, txtactiveCal.Text.Trim).Execute()
'SO FAR SO GOOD!
'Add email reminder to event
Dim remR As New EventReminder()
remR.Method = "email"
remR.Minutes = 10
erResp.Reminders.Overrides.Add(remR) ' <<< ERROR: Object reference not set to an instance of an object
在最後一塊我想提醒添加到事件(我unserstand這必須在創建活動結束後做什麼?)。在最後一行我得到以下錯誤:
Object reference not set to an instance of an object
有沒有人知道我在做什麼錯在這裏?