Dear all,

I was wondering if there is a way to solve this problem through VBA.

in my office I have the following situation:

client send mail to our general first line mailbox if they can't handle this request they will forward this mail to the second line general mailbox. worst case senario the mail is forwarded to more departments before it's arriving at the second line.

2nd line knows the solution to the problem of this client and want to reply to the client.
if you click by default on the reply button you get the last senders email adres in the TO field which is very annoying since you have to search for the clients email adress first remove all the "useless forwarded content" and form your reply to the client.

what would i like to achieve :

1 retrieve the original email adres of the client
2 remove all the "useless content" between the original mail and my reply
3 change the reply email adres into the clients email adress
4 move the original reply adres to the from field

can someone help me out with this problem?
concerning point 1 I found this function on the internet
Code:
Private Function GetOriginalFromEmail(posStartHeader As Integer, _
        posEndHeader As Integer, strBody As String) As String
    GetOriginalFromEmail = ""
    If (posStartHeader < posEndHeader And posStartHeader > 0) Then
        posStartHeader = posStartHeader + Len(START_MESSAGE_HEADER) + 1
        Dim posFrom As Integer
        posFrom = InStr(posStartHeader, strBody, FROM_MESSAGE_HEADER)
        If (posFrom < posStartHeader) Then
            Return
        End If
        posFrom = posFrom + Len(FROM_MESSAGE_HEADER)
        Dim posReturn As Integer
        posReturn = InStr(posFrom, strBody, Chr$(13))
        If (posReturn > posFrom) Then
            GetOriginalFromEmail = _
                Mid(strBody, posFrom, posReturn - posFrom)
        End If
    End If
End Function
thanks