Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook Calendar
Message
 
 
To
01/10/2007 17:25:02
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01257795
Message ID:
01257847
Views:
19
Hi Chuck,

I tested your code with Outlook 2007 and it works fine. Both, lo_appt.Start and lo_occur.Start return correct date for appointment. Also filter condition could be much simplified
lcFilter = "[Start] >= '" + DTOC(ld_date ) + " 12:00 AM' AND " + ;
			"[Start] < '" + DTOC(GOMONTH(ld_date, 3)) + " 12:00 AM'"
>I'm trying to read from Outlook calendar and having problems enumerating recurring appointments. We have a shared calendar and I'm trying to read in all the appointments into one report but the reccurring appointments show up on each day but they just say the same start date over and over again and I can't get the GetOccurrence to return anything other than null.
>
>
>#DEFINE olFolderCalendar 9
>
>ld_date = {10/07/2007}
>
>LOCAL lo_outlook AS outlook.application, ;
>      lo_mapi    AS OUTLOOK.NameSpace, ;
>      lo_name    AS OUTLOOK.Recipient, ;
>      lo_iscal   AS OUTLOOK.MAPIFolder
>
>lo_outlook = NEWOBJECT('outlook.application')
>lo_mapi = lo_outlook.GetNamespace("MAPI")
>
>lo_name = lo_mapi.CreateRecipient("IS Team Calendar")
>lo_name.Resolve()
>IF lo_name.Resolved
>   lo_ISCal = lo_Mapi.GetSharedDefaultFolder(lo_Name, olFolderCalendar)
>   lo_items = lo_iscal.Items
>   lo_items.Sort("[Start]")
>   lo_items.IncludeRecurrences = .t.
>   lo_filt = lo_items.Restrict('[Start] >= "' + 
CMONTH(ld_date ) + ' ' + PADL(DAY(ld_date ), 2, '0') + ', ' + ;
>                                                 PADL(YEAR(ld_date ), 4, '0') + ' 12:00 AM" AND ' + ;
>                               '[Start] < "' + 
CMONTH(GOMONTH(ld_date, 3)) + ' ' + PADL(DAY(GOMONTH(ld_date, 3)), 2, '0') + ', ' + ;
>                                                 PADL(YEAR(GOMONTH(ld_date, 3)), 4, '0') + ' 12:00 AM"')
>   lo_appt = lo_Filt.GetFirst()
>   DO WHILE NOT ISNULL(lo_appt)
>      WITH lo_appt
>        IF .IsRecurring
>            lo_recpat = .GetRecurrencePattern()
>            lo_occur  = lo_recpat.GetOccurrence(.Start)
>            *-- lo_occur is always null
>        ENDIF
>        ? .Organizer
>        ? .Start && This is always the start date of the recurring appointment
>        ? .End
>        ? .Subject
>        ?
>      ENDWITH
>      lo_appt = lo_Filt.GetNext()
>   ENDDO
>ENDIF
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform