+ Reply to Thread
Results 1 to 4 of 4

Importing body text from Outlook email to Excel throws up an error

  1. #1
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Importing body text from Outlook email to Excel throws up an error

    I've cobbled together the code below from hunting around on this forum but it's not working.
    Please Login or Register  to view this content.
    The line in red shows the error "Method 'Body' of object '_MailItem' failed".

    Any ideas on why it throws this up rather than copying the body text to the worksheet?

    I will also need to amend this to look for the folder "TEST" in a shared inbox rather than my own one so any help on that would also be greatly appreciated.

    Thanks in advance.

    B.

  2. #2
    Forum Contributor
    Join Date
    08-08-2005
    Location
    Kansas, USA
    MS-Off Ver
    2016
    Posts
    293

    Re: Importing body text from Outlook email to Excel throws up an error

    Two things:
    1) You need a reference set to the MS Outlook Object library. Use Tools/References in the VBA editor to set this.
    2) The code will trigger a dialog box asking if you want to allow Excel to access Outlook. If that dialog box is hidden by another window, it may appear things are not working.

  3. #3
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Importing body text from Outlook email to Excel throws up an error

    Thanks for the reply.
    1) I have a reference set to the Outlook Library. The code wouldn't get as far as it did without that.
    2) There is no dialog box, hidden or otherwise. Just the error message detailed above.

    I tried the same code on my home computer and it works fine. But when in the office and on the network it doesn't. And that's where I really need it to work.

    B.

  4. #4
    Forum Contributor
    Join Date
    08-08-2005
    Location
    Kansas, USA
    MS-Off Ver
    2016
    Posts
    293

    Re: Importing body text from Outlook email to Excel throws up an error

    If you don't get any dialog box asking permission to access the Outlook application, then maybe there's a security issue, you might ask your IT folks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Extract multiple lines of text from Outlook email body into Excel
    By Ranger75 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-07-2018, 03:47 PM
  2. Getting Error while extracting body of the email from Outlook 2013 using Excel VBA
    By Naveed Raza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2016, 10:47 AM
  3. Replies: 8
    Last Post: 03-11-2015, 07:53 PM
  4. Run-Time Error 4065 - Pasting Copied Data from Excel to Outlook Email Body
    By jtn260 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2014, 11:03 AM
  5. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  6. Add to Excel from Outlook when a email body contain a specific text
    By mathewfer in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 05-08-2013, 08:28 AM
  7. Using Excel vba to send hyperLinks in the body text of an Outlook email using a checkbox
    By PatrickASnyder in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2013, 04:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1