How to add item from application to local mobile calendar
-
I am now developing a mobile application using Mobile Client Software Factory. Currently what i need to do is, I have a screen where it have a choice of events, I will the button where it will add the event from the system to the calendar that build in with mobile application and this will be the reminder. Can i know whether this can be done? Thanks.
-
I am now developing a mobile application using Mobile Client Software Factory. Currently what i need to do is, I have a screen where it have a choice of events, I will the button where it will add the event from the system to the calendar that build in with mobile application and this will be the reminder. Can i know whether this can be done? Thanks.
Have a look at the following article on developer.com - http://www.developer.com/ws/pc/article.php/10947_3556186_1[^]. It contains step by step instructions on how to add the required references etc in order to use the Microsoft.WindowsMobile.PocketOutlook assembly. You can also find a very good example here which does exactly what you want - http://rareedge.com/gmobilesync/2006/12/08/add-appointments-to-pocketoutlook/[^]. I have reposted the code example here for you:
using System; using Microsoft.WindowsMobile.PocketOutlook; public class PocketOulookSample { public void AddAppointment() { Appointment appointment = new Appointment(); using (OutlookSession outlook = new OutlookSession()) { appointment.Subject = “Bake a cake”; appointment.Start = DateTime.Now.AddDays(1); appointment.AllDayEvent = true; appointment.Body = “Nicole loves cake!”; appointment.Location = “Kitchen”; appointment.Sensitivity = Sensitivity.Personal; outlook.Appointments.Items.Add(appointment); } } }
Hope it helps, Christopher Fairbairn -
Have a look at the following article on developer.com - http://www.developer.com/ws/pc/article.php/10947_3556186_1[^]. It contains step by step instructions on how to add the required references etc in order to use the Microsoft.WindowsMobile.PocketOutlook assembly. You can also find a very good example here which does exactly what you want - http://rareedge.com/gmobilesync/2006/12/08/add-appointments-to-pocketoutlook/[^]. I have reposted the code example here for you:
using System; using Microsoft.WindowsMobile.PocketOutlook; public class PocketOulookSample { public void AddAppointment() { Appointment appointment = new Appointment(); using (OutlookSession outlook = new OutlookSession()) { appointment.Subject = “Bake a cake”; appointment.Start = DateTime.Now.AddDays(1); appointment.AllDayEvent = true; appointment.Body = “Nicole loves cake!”; appointment.Location = “Kitchen”; appointment.Sensitivity = Sensitivity.Personal; outlook.Appointments.Items.Add(appointment); } } }
Hope it helps, Christopher Fairbairn