title: Extract outlook message body text with VBA from Excel
body: <p>I have a huge number of Outlook .msg and Outlook .eml files saved to a shared network folder (ie outside of Outlook). I am trying to write some VBA in Excel that extracts the Subjects，Sender, CC, Receiver, SentTime, SentDate, message body text from each file and import these info to Excel cells orderly </p>
  
  <p>Subject  Sender   CC     Receiver    SentTime   SentDate</p>
  
  <p>Re:..     Mike   Jane    Tom     12:00:00    23 Jan 2013</p>
  
  <p>I've done a similar thing with word documents but I'm struggling to 'get at' the text in the .msg files.</p>
  
  <p>So far I have the code below. I like to think I'm on the right track at least, but I'm stuck at the line where I'm trying to set up a reference to the msg file. Any advice will be appreciated...</p>
  
  <pre><code>Dim MyOutlook As Outlook.Application
  Dim MyMail As Outlook.MailItem
  
  Set MyOutlook = New Outlook.Application
  
  
  Set MyMail = 
  
  Dim FileContents As String
  
  FileContents = MyMail.Body
  </code></pre>
  
  <p>Regards</p>