Results 1 to 2 of 2

How to extract outlook mail full body context and not just the text?

Threaded View

vbahelppls How to extract outlook mail... 08-18-2015, 02:20 AM
FDibbins Re: How to extract outlook... 08-18-2015, 02:29 AM
  1. #1
    Registered User
    Join Date
    08-17-2015
    Location
    london
    MS-Off Ver
    2010
    Posts
    2

    How to extract outlook mail full body context and not just the text?

    Hi, sorry for the repost, my previous thread was a bit confusing:

    I would like to extract the content in the mail onto excel spreadsheet, the following code worked for me but it only extracts the olMail.Body which is the plain text, but I receive data in excel table format (i.e. when you copy a table from excel directly into email), but I cant seem to extract it, could someone pls help me amend the below code? thank you so much!

    Sub GetFromInbox()
    
         Dim olApp As Outlook.Application
         Dim olNs As Namespace
         Dim Fldr As MAPIFolder
         Dim olMail As Variant
         Dim i As Integer
    
         Set olApp = New Outlook.Application
         Set olNs = olApp.GetNamespace("MAPI")
         Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
         
         i = 1
    
         For Each olMail In Fldr.Items
             If InStr(olMail.Body, "testt") > 0 Or _
                 InStr(olMail.Subject, "testt") > 0 Then
    
                 ActiveSheet.Cells(i, 1).Value = olMail.ReceivedTime
                 i = i + 1
             End If
         Next olMail
    
         Set Fldr = Nothing
         Set olNs = Nothing
         Set olApp = Nothing
    
     End Sub
    Last edited by FDibbins; 08-18-2015 at 02:29 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 08-17-2015, 11:00 PM
  2. Format Outlook Mail Body using VBA
    By prabhubox@yahoo.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-27-2014, 07:02 AM
  3. Replies: 1
    Last Post: 01-20-2014, 09:31 AM
  4. [SOLVED] How to copy table from Outlook mail body in to text file
    By Draconi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-04-2013, 02:43 AM
  5. Convert text into bitmap and paste on mail body of outlook
    By Deepak -WFM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2013, 07:12 AM
  6. Send e-mail with image on body (.html) on e-mail manager <> outlook
    By mariotnc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2012, 09:28 PM
  7. Extract outlook message body text with VBA from Excel
    By jamsta1972 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-31-2012, 05:43 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