title: Adding an Appointment to Multiple Calendars in Outlook
body: <p>I am creating an outlook AddIn in Visual Studio 2010.</p>
  
  <p>I have two Outlook Calendars:  1) default exchange calendar and 2) Personal Time Tracking Calendar.  I have a form region that displays account numbers to track my time to depending on the task.</p>
  
  <p>What I would like to do is if the appointment is in my personal calendar, I would like to add the appointment also to my time tracking calendar.</p>
  
  <p>I've tried this:</p>
  
  <pre><code>var outlook = new Application();
  var appt = OutlookItem as AppointmentItem;
  
  if (appt == null)
      return;
  
  try
  {
  
      if (!string.IsNullOrEmpty(txtbxCapNum.Text))
      {
          if (appt.UserProperties.Find(Constants.CAPITAL_NUMBER) == null)
          {
              appt.UserProperties.Add(Constants.CAPITAL_NUMBER, OlUserPropertyType.olText);
          }
  
          appt.UserProperties[Constants.CAPITAL_NUMBER].Value = txtbxCapNum.Text;
      }
  
  
      if (!(outlook.Application.ActiveExplorer().CurrentFolder).Name.Equals(Constants.TIME_TRACKING_CALENDAR) &amp;&amp; chbxInclude.Checked)
      {
  
          GetTimeTrackingCalendar(outlook).Items.Add(appt);
      }
  
      appt.Save();
  }
  catch (System.Exception ex)
  {
      MessageBox.Show(ex.Message);
  }
  </code></pre>
  
  <p>Where GetTimeTrackingCalendar is defined as:</p>
  
  <pre><code>public static MAPIFolder GetTimeTrackingCalendar(Application outlook )
  {
      MAPIFolder result = null;
      MAPIFolder calendars = (MAPIFolder)outlook.ActiveExplorer().Session.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);
      for (int i = 1; i &lt;= calendars.Folders.Count; i++)
      {
          if (calendars.Folders[i].Name != Constants.TIME_TRACKING_CALENDAR) continue;
          result = calendars.Folders[i];
          break;
      }
      return result;
  }
  </code></pre>
  
  <p>However, the save method returns the following ambiguous error:</p>
  
  <p>=============================================================================</p>
  
  <h1><em>Could not complete the operation. One or more parameter values are not valid.</em></h1>
  
  <p>Anyone know what parameter is not valid or even how to determine which parameter is invalid?</p>
  
  <p>Thanks, BillN</p>