Outlook auto reply

Hi People,
I recieve many emails everyday and every one has a standard reply to it.
What I would like to be able to do is auto reply to the email but use specific details from the original email in the reply.
ie

The original mail looks like this,

Name: Phil Johnson
Password: 12345
Location: North East
Username: PhilJ

And what I would like to do is reply to the mail by picking the name and username and inserting it in a specific location in the reply.

So the reply would look

Hi Phil,

You username is PhilJ and your password is 12345.

If you have any further questions please mail at@whatever.

Thanks

me.

Can any one help me out with this.

cheers guys.
pnorris98Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

meschCommented:
Do your incoming mails always have the same format?
0
pnorris98Author Commented:
hi there thanks for getting back so quick,
yes the incoming mails always have the same format.
0
meschCommented:
so you can parse the body property of the mail for the fixed values like Name,Password,Location and Username to get the values. With this values you can create a new reply message with your personalized text. Create a string template of you reply message mit place holders. like this:

Hi <Name>,

You username is <Username> and your password is <Password>.

If you have any further questions please mail at@whatever.

Thanks

You only have to replace the place holders with the value of the parsed original message using the Replace function.

0
pnorris98Author Commented:
Thanks for that Mesch, but can you explain it in laymans terms for me, my apologies but I am some what of a novice when it comes to things like this.
0
meschCommented:
Okay here is some code that i wrote to test your explanations and extract the users data. You have to select one or more items in you inbox and start the button.
If you need more help drop me a line...

Sub FormattedReply()
Dim oItem As MailItem
Dim strName
Dim strPassword
Dim strLocation
Dim strUserName

For Each oItem In Application.ActiveExplorer.Selection
   'MsgBox oitem.Body
   'Debug.Print InStr(1, oItem.Body, "Name: ")
   
   strName = Mid(oItem.Body, InStr(1, oItem.Body, "Name: ") + Len("Name: "), InStr(InStr(1, oItem.Body, "Name: ") + Len("Name: "), oItem.Body, vbLf) - (InStr(1, oItem.Body, "Name: ") + Len("Name: ")))
   strPassword = Mid(oItem.Body, InStr(1, oItem.Body, "Password: ") + Len("Password: "), InStr(InStr(1, oItem.Body, "Password: ") + Len("Password: "), oItem.Body, vbLf) - (InStr(1, oItem.Body, "Password: ") + Len("Password: ")))
   strUserName = Mid(oItem.Body, InStr(1, oItem.Body, "Username: ") + Len("Username: "), InStr(InStr(1, oItem.Body, "Username: ") + Len("Username: "), oItem.Body, vbLf) - (InStr(1, oItem.Body, "Username: ") + Len("Username: ")))
   
   '-- type in the code to reply to the message
   'Debug.Print strName & vbLf & strPassword & vbLf & strUserName
Next

End Sub



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.