AttachedTemplate Property Example

This example displays the name and path of the template attached to the active document.

Set myTemplate = ActiveDocument.AttachedTemplate
MsgBox myTemplate.Path & Application.PathSeparator _
    & myTemplate.Name

This example inserts the contents of the Spike (a built-in AutoText entry) at the beginning of document one.

Set myRange = Documents(1).Range(0, 0)
Documents(1).AttachedTemplate.AutoTextEntries("Spike") _
    .Insert myRange

This example attaches the template "Letter.dot" to the active document.

ActiveDocument.AttachedTemplate = "C:\Templates\Letter.dot"