POOM sample: creating a new private task
Neither Outlook nor Pocket Outlook marks tasks as private. If you have a private PC it's not a problem but if you work with an Exchange server some companies leave your mailbox configure so -everyone- can see your "public" tasks. My tasks are private and they should stay so.
The following code sample uses the Pocket Outlook .NET Compact Framework class library to create a new task, set the due date to today, an mark it as private and display it so the user can enter subject and notes:
public enum Sensitivity
{
Normal = 0 ,
Personal = 1,
Private = 2,
Confidential = 3
}
…
/// <summary>
/// Create a new task. The due date is set to Today
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuNew_Click(object sender, System.EventArgs e)
{
PocketOutlook.Task task = (PocketOutlook.Task) _pocketOutlook.GetDefaultFolder(olFolderTasks).Items.Add();
task.Sensitivity = PocketOutlook.Sensitivity.Private;
task.DueDate = System.DateTime.Today;
task.Save();
task.Display();
//reloadTasks();
}
No comments:
Post a Comment