?
Solved

Outlook autoreply rule

Posted on 2012-03-20
4
Medium Priority
?
2,038 Views
Last Modified: 2012-06-27
Hi All,
Scripting is definitely not my strong suite and would really appreciate some help with an issue I am facing at the moment.
Running in an Exchange 2007/Outlook 2010 environment.

My question is, is there a way to automate a reply received from a specific address/mailbox?  The reply would need to include the original emails subject line and a brief your email has been received and will now be processed message.
I have had a look at setting this up using Outlook rules, with the actions being run a script or perform a custom action (reply using a specific template – does not allow the original message subject line to be included).

Cheers,
Adam

* I have found a script that works well, and nearly does everything that I am after, the only thing that I need changed is the subject line to use the original email subject.

Sub AutoReply(Item As Outlook.MailItem)
    Dim olkReply As Outlook.MailItem
    Set olkReply = Item.Reply
    With olkReply
        'Change the subject on the next line as desired'
        .Subject = "Your Subject Goes Here"
        'Change the body as desired'
        .HTMLBody = "Your reply text goes here.<bt><br>" & olkReply.HTMLBody
        .Send
    End With
    Set olkReply = Nothing
End Sub
0
Comment
Question by:whitewire
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 37746636
Hi, Adam.

You're so very close to the solution.  To get the subject of the message that triggered the rule you just need Item.Subject.  Like this.

Sub AutoReply(Item As Outlook.MailItem)
    Dim olkReply As Outlook.MailItem
    Set olkReply = Item.Reply
    With olkReply
        'Change the subject on the next line as desired'
        .Subject = Item.Subject
        'Change the body as desired'
        .HTMLBody = "Your reply text goes here.<bt><br>" & olkReply.HTMLBody
        .Send
    End With
    Set olkReply = Nothing
End Sub

Open in new window

0
 

Author Comment

by:whitewire
ID: 37750403
Hi BlueDevilFan,

Thanks for your help, i have replaced the required line with the one you have provided, but now the script is not working at all, I have restored back to the original, and also deleted the module and recreated. This has not corrected the issue, I am really confused as this was working all day yesterday. There are currently no replys being generated as nothing appears in the sent item box.

cheers,
Adam
0
 

Author Comment

by:whitewire
ID: 37750472
I was creating a new module within Visual Basic Editor, i have pasted amended script into this outlook session and replys are now being recieved.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 37750591
Good deal.  Glad you have it working.  Cheers!
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Mailbox Overload?
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question