ThrottleWorks
Excel Ninja
Hi,
I am searching 2 key words in e-mail body.
I am getting their start points with the code.
How do I copy e-mail body within these 2 key words in excel.
Can anyone please help me in this.
I am using below code to get starting points.
I want to copy data between SLine and ELine in excel.
I am searching 2 key words in e-mail body.
I am getting their start points with the code.
How do I copy e-mail body within these 2 key words in excel.
Can anyone please help me in this.
I am using below code to get starting points.
I want to copy data between SLine and ELine in excel.
Code:
For Each oins In oApp.Inspectors
Dim outlookApp
Dim olNs As Outlook.Namespace
Dim Fldr As Outlook.MAPIFolder
Dim olMail As Variant
Dim myTasks
Dim sir() As String
Set outlookApp = CreateObject("Outlook.Application")
Set olNs = outlookApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
Set myTasks = Fldr.Items
Dim SLine As Long
Dim ELine As Long
If (InStr(1, oins.CurrentItem.Body, "From: ", vbTextCompare) > 0) Then
SLine = InStr(1, oins.CurrentItem.Body, "From: ", vbTextCompare)
MsgBox SLine
End If
If (InStr(1, oins.CurrentItem.Body, "Subject: ", vbTextCompare) > 0) Then
ELine = InStr(1, oins.CurrentItem.Body, "Subject: ", vbTextCompare)
MsgBox ELine
End If
Next