To simply Reply or ReplyAll selected messages try the following.
Option Explicit
Sub ReplyMSG()
Dim olItem As Outlook.MailItem
Dim olReply As MailItem ' Reply
Dim olRecip As Recipient ' Add Recipient
For Each olItem In Application.ActiveExplorer.Selection
Set olReply = olItem.ReplyAll
Set olRecip = olReply.Recipients.Add("Email Address Here") ' Recipient Address
olRecip.Type = olCC
olReply.HTMLBody = "Hello, Thank you. " & vbCrLf & olReply.HTMLBody
olReply.Display
'olReply.Send
Next olItem
End Sub
To hide the recipient use BCC
Example
olRecip.Type = olBcc
To add multiple recipient just add
Set olRecip = olReply.Recipients.Add("Email Here")
Set olRecip = olReply.Recipients.Add("Email Here")
Set olRecip = olReply.Recipients.Add("Email Here")
With out Recipient try the following.
Option Explicit
Sub ReplyMSG()
Dim olItem As Outlook.MailItem
Dim olReply As MailItem ' Reply
For Each olItem In Application.ActiveExplorer.Selection
Set olReply = olItem.ReplyAll
olReply.HTMLBody = "Hello, Thank you. " & vbCrLf & olReply.HTMLBody
olReply.Display
'olReply.Send
Next olItem
End Sub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…