Back to blog

Use a Macro to Respond with an Email Template

byNeil Malek

Use a Macro to Respond with an Email Template

Here are the two versions of this macro – one for new emails, and one for responding to emails:

Sub NewEmailTemplate()
  Set msg = Application.CreateItemFromTemplate(" <FILEPATH HERE>\<FILENAME HERE>.oft ")
  msg.Display
End Sub
Sub ReplyEmailTemplate()
        Dim origEmail As MailItem
	Dim replyEmail As MailItem

	Set origEmail = Application.ActiveWindow.Selection.Item(1)
	Set replyEmail = Application.CreateItemFromTemplate(" <FILEPATH HERE>\<FILENAME HERE>.oft")

	replyEmail.To = origEmail.Sender
	replyEmail.CC = origEmail.CC
	replyEmail.Subject = origEmail.Subject
	
	replyEmail.HTMLBody = replyEmail.HTMLBody & origEmail.Reply.HTMLBody
	replyEmail.Display
End Sub

View more about this topic

Related everyday office posts