title: Mark Outlook TaskItem as Completed in C#
body: <p>I'm creating an Outlook Task with status marked as Completed</p>
  <pre class="lang-cs prettyprint-override"><code>                    if (task != null)
                      {
                          task.Subject = mi.Subject;
                          task.Status = (Outlook.OlTaskStatus)2; //Status remains 0
                          task.StartDate = DateTime.Now;
                          task.Save();
                      }
  </code></pre>
  <p><code>Outlook.OlTaskStatus</code> is an <code>enum</code> and value of Complete state is 2. But it remains 0 and task is not marked as completed. Number of ways i've tried till to mark task as completed are as following:</p>
  <ol>
  <li><code>task.Status = Outlook.OlTaskStatus.olTaskComplete;</code></li>
  <li><code>task.MarkComplete();</code></li>
  <li><code>task.Complete=true;</code></li>
  <li><code>task.Status = (Outlook.OlTaskStatus)2;</code></li>
  </ol>
  <p>Nothing appears to be effective and <code>Status</code> is still <code>0</code>. Can someone please suggest the right way to mark an outlook task <code>Complete</code> ?</p>