PocketOutlook のカテゴリ一覧を C# から取得できないかなと思い、調べていたらこんな感じで取得することができたので覚書。
例えば「連絡先」の場合
using Microsoft.WindowsMobile.PocketOutlook;
// 連絡先
Contact contact = new Contact();
string temp = contact.Properties[ContactProperty.FolderCategories].ToString();
複数のカテゴリがあった場合、temp には「,」区切りで格納されている。
■サンプル
using Microsoft.WindowsMobile.PocketOutlook;
// 連絡先
Contact contact = new Contact();
string temp = contact.Properties[ContactProperty.FolderCategories].ToString();
string[] categories = temp.Split(',');
this.listBox1.Items.Add("--- 連絡先 ---");
foreach (string str in categories)
{
this.listBox1.Items.Add(str);
}
// 予定表
Appointment appointment = new Appointment();
temp = appointment.Properties[AppointmentProperty.FolderCategories].ToString();
categories = temp.Split(',');
this.listBox1.Items.Add("--- 予定表 ---");
foreach (string str in categories)
{
this.listBox1.Items.Add(str);
}
// 仕事
Task task = new Task();
temp = task.Properties[TaskProperty.FolderCategories].ToString();
categories = temp.Split(',');
this.listBox1.Items.Add("--- 仕事 ---");
foreach (string str in categories)
{
this.listBox1.Items.Add(str);
}
Programing
c#, windows mobile
Permalink