PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Extract several lines of email messages starting from the end

Reply

Extract several lines of email messages starting from the end

 
Thread Tools Rate Thread
Old 16-03-2006, 07:57 PM   #1
scriptnewbie
Guest
 
Posts: n/a
Default Extract several lines of email messages starting from the end


Hi everyone,

I was hoping that someone would give me an idea how to accomplish this.
I would like to pull out say the last 5 lines of all messages in my
Inbox folder and write them all to a text file. I was thinking about
creating a function and set a Position variable to the end of message,
but no success. I can get the first couple lines with the below
function. But how can I write my code to get the last 5 lines of the
messages. Thnx in advance for your help.

Private Function GetPosition(sBody As String) As Long
Dim p As Long
Dim position As Long
position = 1
For p = 1 To 5
position = InStr(position, sBody, vbCrLf)
position = pos + 1
Next
GetPosition = position
End Function

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off