-1

I am new with outlook. I would like to create a template with a link inside. The link would have a variable which would be equal to the email address of the recipient. Is it possible to do it? if so how?

PS: I know nothing about VB, macro... but willing to learn if not too complicated

Thank you.

Greg
  • 640
  • 5
  • 11
  • 23

1 Answers1

0

It is not possible to create a dynamic template. Instead, you can create a template and after creating an Outlook based on the template you may correct the link in the body. The CreateItemFromTemplate method of the Application class creates a new Microsoft Outlook item from an Outlook template (.oft) and returns the new item.

Sub CreateFromTemplate() 
  Dim MyItem As Outlook.MailItem  
  Set MyItem = Application.CreateItemFromTemplate("C:\statusrep.oft")   
  MyItem.Display 
End Sub 

Sub CreateTemplate() 
  Dim MyItem As Outlook.MailItem  
  Set MyItem = Application.CreateItem(olMailItem) 
  MyItem.Subject = "Status Report" 
  MyItem.To = "Dan Wilson" 
  MyItem.Display 
  MyItem.SaveAs "C:\statusrep.oft", OlSaveAsType.olTemplate 
End Sub

I know nothing about VB, macro... but willing to learn if not too complicated

I'd suggest starting from the Getting Started with VBA in Outlook 2010 article in that case. Then you will find a lot of HOW TO articles in the How do I... (Outlook 2013 developer reference) section in MSDN. See also Concepts (Outlook 2013 developer reference).

Finally, you may find the How To: Create a new Outlook message based on a template article heplful.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45