Outlook.TaskItem task = null;
Outlook.RecurrencePattern recPattern = null;
try
{
task = (Outlook.TaskItem)OutlookApp.CreateItem(Outlook.OlItemType.olTaskItem);
task.Subject = "Do billing";
task.StartDate = new DateTime(2013, 06, 25);
task.DueDate = new DateTime(2013, 06, 25);
task.Status = Outlook.OlTaskStatus.olTaskNotStarted;
recPattern = task.GetRecurrencePattern();
recPattern.RecurrenceType = Outlook.OlRecurrenceType.olRecursMonthly;
recPattern.PatternStartDate = new DateTime(2013, 07, 25);
recPattern.NoEndDate = true;
task.Save();
}
finally
{
if (recPattern != null)
Marshal.ReleaseComObject(recPattern);
if (task != null)
Marshal.ReleaseComObject(task);
}
https://www.add-in-express.com/creating-addins-blog/2013/06/12/outlook-tasks-create-get-delete/
No comments:
Post a Comment