- using Microsoft.WindowsMobile.Status;
- using Microsoft.WindowsMobile.Telephony;
- using Microsoft.WindowsMobile.PocketOutlook;
-
- public void AddMemo(){
-
- OutlookSession a = new OutlookSession();
-
- AppointmentCollection col = a.Appointments.Items;
-
- Appointment appoi = col.AddNew();
- appoi.Body = this.txtMemo.Text;
- appoi.Location = this.txtLocation.Text;
- appoi.Start = DateTime.Today;
- appoi.End = DateTime.Today.AddDays(1);
- appoi.Subject = "我是被程式新增的";
- appoi.Update();
- appoi.ShowDialog();
-
- }
using Microsoft.WindowsMobile.Status;
using Microsoft.WindowsMobile.Telephony;
using Microsoft.WindowsMobile.PocketOutlook;
public void AddMemo(){
//取得PDA OutlookSession的執行個體
OutlookSession a = new OutlookSession();
//取得目前行事曆的所有的集合
AppointmentCollection col = a.Appointments.Items;
//建立一個新行事曆
Appointment appoi = col.AddNew();
appoi.Body = this.txtMemo.Text;//內容
appoi.Location = this.txtLocation.Text;//地點
appoi.Start = DateTime.Today;//開始日期
appoi.End = DateTime.Today.AddDays(1);//結束日期
appoi.Subject = "我是被程式新增的";//主旨
appoi.Update();//更新到行事曆的集合中
appoi.ShowDialog();//顯示剛剛新增的行事曆
}