title: Convert MemoryStream object to Outlook.MailItem
body: <p>I am creating Outlook <code>add-in</code> in which I am creating Drag and Drop area.<br>
  I want to get mail which is drag and dropped to my control. I have used following code.:  </p>
  
  <pre><code>    private void DragDropControl_DragDrop(object sender, DragEventArgs e)
      {
          //wrap standard IDataObject in OutlookDataObject
          OutlookDataObject dataObject = new OutlookDataObject(e.Data);
  
          //get the names and data streams of the files dropped
          string[] filenames = (string[])dataObject.GetData("FileGroupDescriptorW");
          //get the Mail Item here.
          MemoryStream[] filestreams = (MemoryStream[])dataObject.GetData("FileContents");
  
          this.label2.Text += "Files:\n";
          for (int fileIndex = 0; fileIndex &lt; filenames.Length; fileIndex++)
          {
              //use the fileindex to get the name and data stream
              string filename = filenames[fileIndex];
              MemoryStream filestream = filestreams[fileIndex];
              this.label2.Text += "    " + filename + "\n";
  
              //save the file stream using its name to the application path
              FileStream outputStream = File.Create(filename);
              filestream.WriteTo(outputStream);
  
              byte[] bytesInStream = new byte[outputStream.Length];
  
              //I don't want to save file to the local drive or something like this.
              var fileStream = File.Create("C:\\TestFileSave\\" + filename + ".msg");
  
              outputStream.Seek(0, SeekOrigin.Begin);
              outputStream.CopyTo(fileStream);
  
              fileStream.Close();
  
              outputStream.Close();
  
              readMessage(filename);
          }
      }
  </code></pre>
  
  <p>In the <code>readMessage(filename)</code> function I have get the saved file and read the <code>MailItem</code>.  </p>
  
  <p>But actual problem occurred when I run outlook without administrator privilege it gives me error like: </p>
  
  <p><img src="https://i.stack.imgur.com/L6Y4F.png" alt="enter image description here"></p>
  
  <p>Is there any other way that without saving the file to local drive convert it to <code>Outlook.MailItem</code>?</p>
  
  <p>Any help will be appreciated.</p>