title: exception in setting Outlook.MailItem.body as rich text
body: <p>I have a RichTextBox for the Message Body 
  and I need to create a new mail with the body of rich Text.
  There is my code how i tried to realize that:</p>
  
  <pre><code>MemoryStream ms = new MemoryStream();
  MemoEditBody.SaveDocument(ms, DevExpress.XtraRichEdit.DocumentFormat.Rtf);
  byte[] RTFBody = ms.ToArray();
  email.oMsg.RTFBody = RTFBody;                                
  </code></pre>
  
  <h3>Types:</h3>
  
  <pre><code>OutlookEMail email;
  public MailItem oMsg;
  </code></pre>
  
  <p>Problem:
  Working with 2010 Outlook - works properly;
  Working with 2007 Outlook -this code throws exception (<code>AccessViolationException: Attempted to read or write protected memory</code>)
  Can someone suggest how to resolve this problem with 2007 Outlook?</p>
  
  <p>P.S. Using :
  Visual studio 2010
  DevExpress</p>
  
  <p>It was tested on two computers, they are almost identical (<em>same windows, same framework, only one has Outlook 2007 another 2010</em>) so it is 80% that problem is in Outlook version.</p>