J
Jack
I am using the following routine to extract data from email(web form) form.
The routine works great for single fields however if a field in the webform
is a memo box. it doesnt work for that field. I believe its because there are
multiple CHR(13) between the fields. For Example the email I get looks like
this:
First name: xxxx
last name: xxx
comments:
xxx this is where comments start.
xxxx and continue
xxxx and continue
Can someone take a look at this sniplet and tell me what is the best way to
correct this? Code follows:
Public Function ExtractDetail(textLine As Variant, FormItemReq As String) As
Variant
Dim StartLine As Variant, EndLine As Variant, ExtractText As Variant
StartLine = InStr(textLine, FormItemReq)
If StartLine > 0 Then
StartLine = StartLine + Len(FormItemReq)
EndLine = InStr(StartLine, textLine, Chr(13))
ExtractText = Mid(textLine, StartLine, EndLine - StartLine)
End If
If Len(ExtractText) = 0 Then ExtractText = ""
ExtractDetail = Trim(ExtractText)
End Function
Thanks, Jack
The routine works great for single fields however if a field in the webform
is a memo box. it doesnt work for that field. I believe its because there are
multiple CHR(13) between the fields. For Example the email I get looks like
this:
First name: xxxx
last name: xxx
comments:
xxx this is where comments start.
xxxx and continue
xxxx and continue
Can someone take a look at this sniplet and tell me what is the best way to
correct this? Code follows:
Public Function ExtractDetail(textLine As Variant, FormItemReq As String) As
Variant
Dim StartLine As Variant, EndLine As Variant, ExtractText As Variant
StartLine = InStr(textLine, FormItemReq)
If StartLine > 0 Then
StartLine = StartLine + Len(FormItemReq)
EndLine = InStr(StartLine, textLine, Chr(13))
ExtractText = Mid(textLine, StartLine, EndLine - StartLine)
End If
If Len(ExtractText) = 0 Then ExtractText = ""
ExtractDetail = Trim(ExtractText)
End Function
Thanks, Jack