0

My macro works but the email is not from my saved template.

Private Sub Application_Reminder(ByVal Item As Object)
  Dim objMsg As MailItem
  Set objMsg = Application.CreateItemFromTemplate("C:\Users\oanderson\AppData\Roaming\Microsoft\Templates\Test template.oft")

  If Item.MessageClass <> "IPM.Appointment" Then
    Exit Sub
  End If

  If Item.Categories <> "Automated Email Sender" Then
    Exit Sub
  End If

  objMsg.To = Item.Location
  objMsg.Subject = Item.Subject
  objMsg.Body = Item.Body
  objMsg.Send

  Set objMsg = Nothing
End Sub
  • What's your question? – thims Aug 3 '18 at 17:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.