title: Get Unique Id From MailItem (Microsoft.Office.Interop.Outlook)?
body: <p>I'm creating an application that is reading emails received in outlook.</p>
  
  <p>The reading process is something like this:</p>
  
  <pre><code>using Outlook = Microsoft.Office.Interop.Outlook;
  
  var app = new Outlook.Application();
  var ns = app.GetNamespace("MAPI");
  ns.Logon(null, null, false, false);
  
  var inboxFolder = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
  var subfolder = inboxFolder.Folders["MyFolderName"];
  
  foreach (Outlook.MailItem item in subfolder.Items)
  {
      // do something
      // item.EntryID
  }
  </code></pre>
  
  <p>I need to get an unique ID for every <code>item</code> in the <code>foreach</code> loop.</p>
  
  <p>There is a <code>EntryID</code> property in <code>Outlook.MailItem</code> that I used and it was working well, but I found out there was a problem with that property: Whenever I moved the email to another folder (inside outlook), This property <code>EntryID</code> changed.</p>
  
  <p>I ran several tests and discovered that the <code>EntryID</code> value changes only a few chars when I move the mail to another folder.</p>
  
  <p>I need an ID that would be unique no matter what folder. Is there an another property from <code>Outlook.MailItem</code> or any substring of <code>EntryID</code> that is always unique?</p>
  
  <p>I'm using:</p>
  
  <ul>
  <li>.NET 4.0;</li>
  <li>Outlook 2010;</li>
  <li>Microsoft.Office.Interop.Outlook.dll version 14.0.0.0.</li>
  </ul>