I am looking for outlook macro which will enable me to reply to all with specific text. I need later to link this macro to icon in the quick access toolbar.
I am looking for outlook macro which will enable me to reply to all with specific text. I need later to link this macro to icon in the quick access toolbar.
The following should work
Sub ReplyToAllWithText() 'Graham Mayor - https://www.gmayor.com - Last updated - 19 Nov 2018 Dim olMsg As MailItem Dim olReply As MailItem Dim olInsp As Inspector Dim wdDoc As Object Dim oRng As Object Dim strTo As String On Error GoTo Err_Handler Set olMsg = ActiveExplorer.Selection.Item(1) Set olReply = olMsg.ReplyAll With olReply .BodyFormat = olFormatHTML .Display Set olInsp = .GetInspector Set wdDoc = olInsp.WordEditor Set oRng = wdDoc.Range oRng.collapse 1 oRng.Text = "This is a line of text." & vbCr & _ "This is another line" & vbCr & _ "This line will be followed by your account signature." End With lbl_Exit: Set olMsg = Nothing Set olReply = Nothing Set wdDoc = Nothing Set oRng = Nothing Exit Sub Err_Handler: Beep Err.Clear GoTo lbl_Exit End Sub
Graham Mayor - MS MVP (Word) 2002-2019
Visit my web site for more programming tips and ready made processes
http://www.gmayor.com
If you are happy it works as you require, add the lineimmediately before the line.sendDo not remove theEnd Withline or the message body will not be written..Display
Graham Mayor - MS MVP (Word) 2002-2019
Visit my web site for more programming tips and ready made processes
http://www.gmayor.com