visual c++ - List all occurences of outlook recurring appointments -


ms outlook provides mapi access outlook calendar items. calendar items can find recurring , non-recurring appointments of outlook. in case of recurring appointments occurences of recurring appointments can found using getoccurence function of recurrencepattern of appointmentitem. getoccurence function take date , time return occurence on date. if occurence exists, return otherwise give exception.

if occurences of recurring appointment have same starttime , endtime providing starttime input getoccurence, works fine. if 1 particular occurence starttime , endtime modified getoccurence not return occurence. other way check occurence every 30 minute interval on every day. approach seems not efficient.

anyone have better idea this?

_applicationptr olapp("outlook.application"); _namespaceptr olmapi; olmapi = olapp->getnamespace("mapi"); hr = olmapi->logon("","",false,false); mapifolderptr olcalendarfolder = olmapi->getdefaultfolder(olfoldercalendar); _itemsptr olcalendaritems = olcalendarfolder->getitems(); _appointmentitemptr olappt  = (_appointmentitemptr) olcalendaritems->getfirst(); recurrencepatternptr recurpattern = olappt->getrecurrencepattern(); _appointmentitemptr _olappt = recurpattern->getoccurrence(recurpattern->getpatternstartdate()+recurpattern->getstarttime()); 

sure, use recurrencepattern.exceptions collection - see http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.exceptions.aspx


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -