Reply with custom form & selected data from message body

G

GregoryL.[AITI]

Hi everyone,

I receive a lot of plain text emails that contain data in a preset format
that I would like to auto reply with a custom form I have built. I would like
to know if I can locate and use certain values from the original message in
my reply (e.g. original msg contains as plain text First Name: John and
Coffee Type: Arabica. Can I locate John and Arabica in the original msg and
populate those values in my auto reply form -> Hi John, thanks for your
enquiry about our Arabica coffee range...)

It seems straight forward enough yet any help or pointers in the right
direction would be greatly appreciated.


TIA

Greg
 
G

GregoryL.[AITI]

Thanks Sue for the pointers and links, I'm almost there!

The example at
http://www.outlookcode.com/threads.aspx?forumid=2&messageid=696 is very close
to what I'm dealing with except the data value attached to each label is on
the line below it - see example...

<snip>
Q. Email Address
A. (e-mail address removed)

Q. First Name
A. John

Q. Coffee Type
A. Arabica
<snip>

I can successfully locate & return the Email Address label, how do I go the
next step and get the code to locate the label but return the line below it
for trimming and insertion into my reply email?

TIA -Greg
 
S

Sue Mosher [MVP]

I'd use the same text parsing functions, Instr() and Mid(). Use Instr() to
search for the text "Email Address", then from that starting position,
search for the text "A:", etc. Use Mid() to clip the text.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top