Microsoft Office Tutorials and References
In Depth Information
Auto Replying to Selected E-mail Messages
Auto Replying to Selected E-mail Messages
With this procedure you can send a predefined message as a reply to selected e-
mail messages.
Note: This procedure provides code using the Redemption object, which requires
installation of the Redemption COM Object.
View the Appendix to learn how to store this procedure
in a Standard module.
Option explicit¶
' * * * * *
Public Sub SendAutoReply()¶
'Outlook Application Objects declaration¶
Dim objExp As Outlook.Explorer¶
Dim objMail As Outlook.MailItem¶
Dim objItem As Object¶
'Redemption SafeMail object declaration¶
Dim objSafeMail As Object¶
'Auto Reply message variable¶
Dim strReplyMessage As String¶
'Set this variable as desired¶
strReplyMessage = "Thank you! Your order will be " & _¶
"processed immediately!"¶
'Set active explorer object¶
Set objExp = Application.ActiveExplorer¶
'Loop in selected items in Active Explorer¶
For Each objItem In objExp.Selection¶
'If selected item is a mail item then execute¶
'auto reply function¶
If objItem.Class = olMail Then¶
'Set mail item object as the selected item¶
Set objMail = objItem¶
'Create a reply mail object by using selected mail object¶
Set objMail = objMail.Reply¶
'Redemption Addition starts here¶
'Create Redemption SafeMail object¶
'Use this object to send message without¶
'security warning¶
Set objSafeMail = CreateObject("Redemption.SafeMailItem")¶
Set objSafeMail.Item = objMail¶
'Redemption Addition stops here¶
'Add requested auto message to current message as reply¶
With objSafeMail 'Using Redemption Safe Mail Item object¶
.HTMLBody = strReplyMessage & vbCrLf & .HTMLBody¶
'For Plain Text reply, use the following¶
Search JabSto ::

Custom Search