PDA

View Full Version : automatically response / reply



reza_doang
12-16-2014, 12:02 AM
Hi,

Background
My work now as service desk and i have KPI that need to response email for any request within 15 minutes.
so, is it possible i can do that using macro or something :)

Target
Outlook will automatic reply with words "Acknowledge, we will check" for any email with specific subject "REQDATA2014". but reply will work with


only new mail comes (not from replying mail RE: )
Reply using the original body not using template


I have searched and was trying using template only, so the replied mail will use template not the original mail.

Please help and let me know if there is information needed

Thanks in advance :)

gmayor
12-25-2014, 12:21 AM
It has been a few days since your post but it is the holiday season :)

What you ask is fairly straightforward, but it isn't really within the spirit of the task.:devil2:

Call the following script from an Outlook Rule that applies to incoming messages. I have commented out the subject check as this would be better included as part of the rule itself, but you can put it back if you wish. The reply will include the original message with your message and default signature at the top.


Sub Acknowledge(olItem As Outlook.MailItem)
Dim i As Long, j As Long
Dim olOutMail As Outlook.MailItem
Dim olInsp As Outlook.Inspector
Dim wdDoc As Object
Dim oRng As Object
'If InStr(1, olItem.Subject, "REQDATA2014") > 0 Then
If InStr(1, "Re: ") = 0 Then
Set olOutMail = olItem.Reply
With olOutMail
.BodyFormat = olFormatHTML
Set olInsp = .GetInspector
Set wdDoc = olInsp.WordEditor
Set oRng = wdDoc.Range(0, 0)
oRng.Text = "Acknowledge, we will check"
.Display
.Send
End With
Set olOutMail = Nothing
End If
'End If
lbl_Exit:
Exit Sub
End Sub

To test it comment out the .Send line and use the following macro with a selected message in your inbox. It will produce the reply without sending it.


Sub Test1()
Dim olMsg As MailItem
On Error Resume Next
Set olMsg = ActiveExplorer.Selection.Item(1)
Acknowledge olMsg
lbl_Exit:
Exit Sub
End Sub