title: Save changes to a mailitem's inspector
body: <p>I am writing a script in PowerShell 2.0 to create a bunch of appointments on a calendar using an outlook COM object.  I had the code fully working, but the end user requested adding formatted tables to the body of the appointments.  After trying several other options I ended up using the <code>Mailitem.GetInspector.WordEditor</code> to edit the body.  However I am unable to get the body to be saved without having to open the item in Outlook and hitting save.  Here is the relevant code:</p>
  
  <pre><code>$newCalenderItem = $folder.Items.Add()
  $newCalenderItem.Subject = $appt.Subject
  $newCalenderItem.Location = $location
  $newCalenderItem.Start = $d.AddHours($timeSlot.Time)
  $newCalenderItem.Duration = 60 * $timeSlot.Duration
  $newCalenderItem.BusyStatus = 2
  $newCalenderItem.ReminderSet = $false
  $newCalenderItem.Categories = $appt.Category
  $newCalenderItem.Body = ""
  if ($appt.BodyFile) {
      $newCalenderItem.GetInspector.WordEditor.Range().InsertFile("C:\Body.rtf", "", $false, $false, $false)
  
      #this doesn't save it
      $newCalenderItem.GetInspector.WordEditor.Close([ref] -1)
  }
  #this saves everything but the body
  $newCalenderItem.Save()
  </code></pre>
  
  <p>I have tried <code>GetInspector.Close()</code>, <code>WordEditor.Close()</code>, and <code>WordEditor.Save()</code> which brings up a save as dialog.  Does anyone know how to accomplish this?</p>