ok here is something to get you started, I have left in various options that you can comment out and cutomise as you wish, these include the following
1) use the original subject of the incoming email as subject for reply
2) include in the reply the date and time and body of original email in the body along with your new text
3) include an attachment to the reply
4) send on behalf of another mailbox, useful for departmental usage
5) set the message status of the original email to completed
comment out the bits you dont need and change the email body text as required
please take into account that rpl refers to reply and msg refers to original message
Will the reply be sent by yourself or on behalf of team mailbox
you will need to save the following code within your outlook session and assign a shortcut key or a button on the toolbar
The way to use this is to select with the mouse all of the emails in the inbox or folder you wish to reply to, and then hit your button
it will process all in the selection and leave them where they are, you will need to then move them to a folder of your choice
Code:
'****
' Quick macro to take a selection of emails selected by mouse
' with this selection reply to each with the following
'
' 1) use the subject of original in reply
' 2) attach a standard file (PDF)
' 3) include a standard body of text
' 4) reply on behalf of AUC department
' 5) send the reply
'
' Author Jim Ward
'****
Sub ReplyToSelectionWithAttach2()
'
' Declare objects and variables we need
'
Dim myOlSel As Outlook.Selection
Dim olExp, olCurrentFolder
Dim msg As Outlook.MailItem
Dim rpl As Outlook.MailItem
Dim strMailBody As String
'
' setup what we require
'
Set olExp = Outlook.ActiveExplorer
Set olCurrentFolder = olExp.CurrentFolder
Set myOlSel = olExp.Selection
'
' Process each message selected
' Modify the subject add attachment send reply
'
strMailBody = "Dear Sender" & vbCrLf & vbCrLf
strMailBody = strMailBody & "Thank you for your email" & vbCrLf & vbCrLf
strMailBody = strMailBody & "As you might imagine, we are very busy at the moment." & vbCrLf & vbCrLf
strMailBody = strMailBody & "If you have any further questions please call our advice line on: 0123 456 7890." & vbCrLf & vbCrLf
strMailBody = strMailBody & "Yours sincerely" & vbCrLf & vbCrLf & vbCrLf
strMailBody = strMailBody & "Claims Handling Team"
For Each msg In myOlSel
Set rpl = Application.CreateItem(olMailItem)
rpl.To = msg.SenderEmailAddress
' rpl.Subject = msg.Subject
' rpl.Subject = "<<<< put your own subject here >>>> or use the original subject as subject"
rpl.SentOnBehalfOfName = "claims"
' rpl.Body = strMailBody & vbCrLf & vbCrLf & "Original Email Received :- " & msg.ReceivedTime & vbCrLf & vbCrLf & msg.Body
rpl.Body = strMailBody
' rpl.Attachments.Add "H:\complaints\standard_reply.pdf"
rpl.Display
' rpl.Send
msg.FlagStatus = olFlagComplete
msg.Save
Set msg = Nothing
Set rpl = Nothing
Next
MsgBox "All emails sent, please move these to required Folder"
End Sub