A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Need help with auto reply based on text in body



 
 
Thread Tools Search this Thread Display Modes
  #2  
Old March 7th 07, 05:09 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Need help with auto reply based on text in body

Sounds like a "run a script" rule action could help. This actually uses not an external script but a VBA procedure with a MailItem or MeetingItem as its parameter. That item is processed by the code:


Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim rep as Outlook.MailItem

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
Set rep = msg.Reply
rep.Body = "Your text goes here"
rep.Send

Set rep = Nothing
Set msg = Nothing
Set olNS = Nothing
End Sub

If you need to parse out an email address from the message body, regular expressions can be helpful for that. See http://www.outlookcode.com/d/vbscript.htm for links to references.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Adam_Rogers" wrote in message ...
Okay, I have looked through the rules in outlook 2000, 2003 and 2007 and can
not find anything that lets me "auto send" mail based off of an email that
will be in the body of the email recieved.
Ebay sends us an email stating that has won the auction
and to contact him with payment info, but the reply to address is the
@ebay.com address. I could have swore there was a way to do this in VBscript
but cant seem to figure it out.
The reason we cant set ebay up to send the info out is because we are
handling ebay sales for an etailer for a commission, and they still want all
payments processed through their secure payment page.
Please feel free to contact me if you think you can help, I am at a brick
wall my vb skills are lacking these days (if you don't use it you
eventually DO lose it)
adam_rogers at hotmail will be the fastest way to get ahold of me. thanks in
advance for any help you can provide!

  #3  
Old March 8th 07, 05:15 AM posted to microsoft.public.outlook.program_vba
Adam_Rogers
external usenet poster
 
Posts: 1
Default Need help with auto reply based on text in body

Thank you so much Sue, my fiancee has been on me to try to figure this one
out for a while now and this looks like it will work for me. you are the best!

"Sue Mosher [MVP-Outlook]" wrote:

Sounds like a "run a script" rule action could help. This actually uses not an external script but a VBA procedure with a MailItem or MeetingItem as its parameter. That item is processed by the code:


Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim rep as Outlook.MailItem

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
Set rep = msg.Reply
rep.Body = "Your text goes here"
rep.Send

Set rep = Nothing
Set msg = Nothing
Set olNS = Nothing
End Sub

If you need to parse out an email address from the message body, regular expressions can be helpful for that. See http://www.outlookcode.com/d/vbscript.htm for links to references.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Adam_Rogers" wrote in message ...
Okay, I have looked through the rules in outlook 2000, 2003 and 2007 and can
not find anything that lets me "auto send" mail based off of an email that
will be in the body of the email recieved.
Ebay sends us an email stating that has won the auction
and to contact him with payment info, but the reply to address is the
@ebay.com address. I could have swore there was a way to do this in VBscript
but cant seem to figure it out.
The reason we cant set ebay up to send the info out is because we are
handling ebay sales for an etailer for a commission, and they still want all
payments processed through their secure payment page.
Please feel free to contact me if you think you can help, I am at a brick
wall my vb skills are lacking these days (if you don't use it you
eventually DO lose it)
adam_rogers at hotmail will be the fastest way to get ahold of me. thanks in
advance for any help you can provide!


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-Accept Meeting Based on Sender [email protected] Outlook - Calandaring 1 January 6th 07 02:28 AM
anything capable to delete junk mails based on body text? zero Outlook Express 7 December 19th 06 10:50 PM
Creating macro that will sort emails into folders based on text in body mugginns Outlook and VBA 5 October 3rd 06 07:49 AM
Forward emails based on text in body of e-mail [email protected] Outlook and VBA 0 August 24th 06 04:37 PM
FYI -Creting server based outo reply rule in outlook CAMC1 Outlook - General Queries 0 August 1st 06 06:26 PM


All times are GMT +1. The time now is 04:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.