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
Bookmarks