Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to export Outlook email body text to Excel spreadsheet?

If you want to export the selected email body text of from Outlook to Excel spreadsheet, the method in this article can help you.

Export Outlook email body text to Excel spreadsheet with VBA code

Kutools for Outlook: 100+ New Advanced Tools for Outlook.
Office Tab: Enable Tabbed Editing and Browsing in Office, Just Like Chrome, Firefox, IE 8/9/10.
Classic Menu: Bring Old Menus and Toolbars Back to Office 2007, 2010, 2013, 2016 and 2019.

Export Outlook email body text to Excel spreadsheet with VBA code<

Please run the below VBA code to export selected body text of an Outlook email to Excel.

1. Open the email, select the email body you want to export to Excel spreadsheet, and then press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, click Insert > Module. And then copy below VBA code into the Code window.

VBA code: export Outlook email body text to Excel spreadsheet

Sub ExportToExcel()
Dim xExcel As Excel.Application
Dim xWb As Workbook
Dim xWs As Worksheet
Dim xInspector As Inspector
Dim xItem As Object
Dim xMailItem As MailItem
Dim xDoc As Document
Dim xShell As Object
Dim xFilePath As String
On Error Resume Next
    Set xShell = CreateObject("Shell.Application")
    Set xFolder = xShell.BrowseForFolder(0, "Select a Folder:", 0, 0)
    If TypeName(xFolder) = "Nothing" Then Exit Sub
    Set xFolderItem = xFolder.Self
    xFilePath = xFolderItem.Path & "\"
    Set xItem = Outlook.Application.ActiveExplorer.Selection.item(1)
    If xItem.Class <> olMail Then Exit Sub
    Set xMailItem = xItem
    Set xInspector = xMailItem.GetInspector
    Set xDoc = xInspector.WordEditor
    xDoc.Application.Selection.Range.Copy
    xInspector.Close olDiscard
    Set xExcel = New Excel.Application
    Set xWb = xExcel.Workbooks.Add
    Set xWs = xWb.Sheets.item(1)
    xExcel.Visible = False
    xWs.Activate
    xWs.Paste
    xWs.SaveAs xFilePath & "Email body.xlsx"
    xWb.Close True
    xExcel.Quit
    Set xWs = Nothing
    Set xWb = Nothing
    Set xExcel = Nothing
End Sub

Note: In the code, “Email body.xlsx” is the workbook name you will create with the selected email body text. You can change it based on you need.

3. Click Tools > References. Then check both the Microsoft Excel Object Library and Microsoft Word Object Library boxes in the References – Project dialog box. See screenshot:

4. Then a Browse For Folder dialog box pops up, please select a folder to save the workbook and click the OK button.

Now a workbook named “Email body” is created and saved into a specified folder. Open the workbook, you can see the selected email body text is exported to Sheet1 of the workbook.



Recommended Productivity Tools

shot kutools outlook kutools tab 1180x121
shot kutools outlook kutools plus tab 1180x121

Kutools for Outlook - More than 100 Advanced Functions for Outlook, Improve 70% Efficiency For you

  • Complicated and repeated operations can be done a one-time processing in seconds.
  • Forward multiple emails individually with one-click, and auto forward by rules.
  • Auto CC/BCC every sending email and easy for customizing rules, and auto reply without requiring exchange server.
  • Powerful junk emails filter, remove duplicate emails, reply with attachment, bunch of one-click operations, and so on...
  • 60-day unlimited free trial. 60-day money back guarantee. 2 years free upgrade and support. Buy once, use forever.
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Michaael Rejano · 3 months ago
    this work but in one email only what if in folder theres a multiple email thats need to be extracted in excel?
  • To post as a guest, your comment is unpublished.
    Divya · 5 months ago
    Hi the code only returned directly, into the excel and not the body of the email, may I know why was that??