M
MMouse99
Hi All,
First of all heres my code :
Sub cliams()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Dim I As Integer
Dim x As Long
Dim xat As String
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.ActiveInspector
Set objItem = myItem.CurrentItem
mybody = objItem.Body
I = Len(mybody)
While x < I
If Mid(mybody, 3, x) = "At:" Then
xat = Mid(mybody, 3, x)
End If
x = x + 1
Wend
MsgBox ("Branch = " & xat & Chr(13) & Chr(10))
End Sub
So heres my problem. I get a forwarded an email - within the message body
there is certain information that I need to see. The body of message is not
that well layed out, but it is always in the same format.
My thoughts are to go through the body of the message and look for key words
and the extract the following text information - as per my example.
I seem to be going astray somewhere with the mid function - I have tried mid$.
I have also tried using a for loop.
Any thoughts - or help
Many thanks
First of all heres my code :
Sub cliams()
Dim myItem As Outlook.Inspector
Dim objItem As Object
Dim I As Integer
Dim x As Long
Dim xat As String
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.ActiveInspector
Set objItem = myItem.CurrentItem
mybody = objItem.Body
I = Len(mybody)
While x < I
If Mid(mybody, 3, x) = "At:" Then
xat = Mid(mybody, 3, x)
End If
x = x + 1
Wend
MsgBox ("Branch = " & xat & Chr(13) & Chr(10))
End Sub
So heres my problem. I get a forwarded an email - within the message body
there is certain information that I need to see. The body of message is not
that well layed out, but it is always in the same format.
My thoughts are to go through the body of the message and look for key words
and the extract the following text information - as per my example.
I seem to be going astray somewhere with the mid function - I have tried mid$.
I have also tried using a for loop.
Any thoughts - or help
Many thanks