Hemant Sonawane
New Member
- Outlook version
- Outlook 2010 32 bit
- Email Account
- Exchange Server 2010
Hi Expert,
Below Autoreply with template code works fine. I just want after replying, original massage should be unread
please help with change in macro.
Sub AutoReplywithTemplate(Item As Outlook.MailItem)
Dim oRespond As Outlook.MailItem
' Use this for a real reply
' Set oRespond = Item.Reply
' This sends a response back using a template
Set oRespond = Application.CreateItemFromTemplate("C:\path\to\template.oft")
With oRespond
.Recipients.Add Item.SenderEmailAddress
.Subject = "Your Subject Goes Here"
.HTMLBody = "Your reply text goes here." & vbCrLf & _
"---- original body below ---" & vbCrLf & _
Item.HTMLBody & vbCrLf & _
"---- Template body below ---" & _
vbCrLf & oRespond.HTMLBody
' includes the original message as an attachment
.Attachments.Add Item
' use this for testing, change to .send once you have it working as desired
.Display
End With
Set oRespond = Nothing
End Sub
Thanks
Hemant
Below Autoreply with template code works fine. I just want after replying, original massage should be unread
please help with change in macro.
Sub AutoReplywithTemplate(Item As Outlook.MailItem)
Dim oRespond As Outlook.MailItem
' Use this for a real reply
' Set oRespond = Item.Reply
' This sends a response back using a template
Set oRespond = Application.CreateItemFromTemplate("C:\path\to\template.oft")
With oRespond
.Recipients.Add Item.SenderEmailAddress
.Subject = "Your Subject Goes Here"
.HTMLBody = "Your reply text goes here." & vbCrLf & _
"---- original body below ---" & vbCrLf & _
Item.HTMLBody & vbCrLf & _
"---- Template body below ---" & _
vbCrLf & oRespond.HTMLBody
' includes the original message as an attachment
.Attachments.Add Item
' use this for testing, change to .send once you have it working as desired
.Display
End With
Set oRespond = Nothing
End Sub
Thanks
Hemant