Solved

Outlook autoreply rule

Posted on 2012-03-20
4
2,024 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 500 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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 …

717 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