title: Extracting only email body to file
body: <p>I have a VBA script that extracts incoming outlook email into <code>txt</code> files. Here's the code:</p>
  
  <pre><code> ' General Declarations
  Option Explicit
  
  ' Public declarations
  Public Enum olSaveAsTypeEnum
    olSaveAsTxt = 0
    olSaveAsRTF = 1
    olSaveAsMsg = 3
  End Enum
  
  Sub Export_MailasMSG(item As Outlook.MailItem)
  ' Routine will take all selected mails and export them as .MSG files to the
  ' directory defined by
  ' Error Handling
  On Error Resume Next
  
  ' Varaiable Declarations
  Dim strExportFolder As String: strExportFolder = "C:\OutlookEmails\"
  Dim strExportFileName As String
  Dim strExportPath As String
  Dim strReceivedTime As String
  Dim strSubject As String
  Dim objRegex As Object
  
  ' Initiate regex search
  Set objRegex = CreateObject("VBScript.RegExp")
  With objRegex
  .Pattern = "(\s|\\|/|&lt;|&gt;|\|\|\?|:)"
  .Global = True
  .IgnoreCase = True
  End With
  
      ' If the currently selected item is a mail item we can proceed
      If TypeOf item Is Outlook.MailItem Then
          ' Format the file name
          strReceivedTime = item.ReceivedTime
          strSubject = item.Subject
          strExportFileName = Format(strReceivedTime, "yyyymmdd", vbUseSystemDayOfWeek, _
                  vbUseSystem) &amp; Format(strReceivedTime, "-hhnnss", _
                  vbUseSystemDayOfWeek, vbUseSystem) &amp; "-" &amp; strSubject
          strExportFileName = objRegex.Replace(strExportFileName, "_")
          ' Export to the predefined folder.
          strExportPath = strExportFolder &amp; strExportFileName &amp; ".txt"
          item.SaveAs strExportPath, olSaveAsTxt
          ' MsgBox ("Email saved to: " &amp; strExportPath)
      Else
          ' This is not an email item.
      End If
  
  
  
  ' Clear routine memory
  Set item = Nothing
  Set objRegex = Nothing
  
  End Sub
  </code></pre>
  
  <p>The txt files I get are as follows:</p>
  
  <pre><code>From:   Name Surname &lt;email@address.com
  Sent:   mercoledì 17 gennaio 2018 12:16
  To: email@email.com
  Subject:    subject here
  
  BODY HERE
  </code></pre>
  
  <p>Can I extract only the mail body, without the from, sent, to and subject lines?
  If so, how can I achieve that? I don't know VBA programming.</p>
  
  <p>I've tried changing this line  <code>"item.SaveAs strExportPath, olSaveAsTxt"</code> to <code>" item.Body.SaveAs strExportPath, olSaveAsTxt"</code> but with no luck.</p>