Generating a reply with the original message included


Joined
Sep 16, 2014
Messages
1
Reaction score
0
Hello all,


I work for support and many of our users have similar requests, so I wanted to create a code that generates a reply with specific content. I was able to generate the response but it doesn’t include the body of the original email. I tried to use “olincludeOriginalText” but it doesn’t work, although the others do (like “olLinkOriginalItem”)


How do I achieve my goal of generating a reply with the original message included.


Below is my code


Thank you,



Sub wellview_install_2()


Dim objMail As Outlook.mailItem
'objMail is my reply

Dim objitem As Outlook.mailItem
'bojitem is the original email I'm replying to

Dim objAction As Outlook.action



Set objitem = GetCurrentItem()


Set objAction = objitem.actions.Add


objAction.Name = "Rep”



objAction.ReplyStyle = olIncludeOriginalText





Set objMail = objAction.Execute



objMail.CC = "PEASD IFPSD Support”



objMail.Body = “bla blab la”


objMail.Display



Set objitem = Nothing


Set objMail = Nothing


End Sub
'*******************************************************************************************************
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = Application
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
End Function​
 
Last edited:
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top