Hi Guy's, can someone help with this one please, i can usually find data using InStr function, in this case, the data i am trying to retrieve is 2 lines after the First Name:
So with being unsure of how many characters after First Name: is the word Phil, so i am using x 2 vbCrlf after First Name, i can't get the name Phil, can somone help and put me right on this please ?
This is the text box strMailMessage
Page submitted on: Contact Us - website name removed/web-agency-gb-contact-us/>
First name:
Phil
Last name:
So with being unsure of how many characters after First Name: is the word Phil, so i am using x 2 vbCrlf after First Name, i can't get the name Phil, can somone help and put me right on this please ?
Code:
Dim fn() As String, ifn As Integer
fn = Split(strMailMessage, vbCrLf)
For ifn = 0 To UBound(fn)
If InStr(1, fn(ifn), "First Name:") > 0 Then
Me.txtName = Mid(fn(ifn), vbCrLf & vbCrLf)
Debug.Print Mid(fn(ifn), 1) & vbCrLf & vbCrLf
End If
Next ifn
This is the text box strMailMessage
Page submitted on: Contact Us - website name removed/web-agency-gb-contact-us/>
First name:
Phil
Last name: