Skip to content

Latest commit

 

History

History
68 lines (38 loc) · 1.42 KB

Word.Document.AttachedTemplate.md

File metadata and controls

68 lines (38 loc) · 1.42 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Document.AttachedTemplate property (Word)
vbawd10.chm158007363
vbawd10.chm158007363
Word.Document.AttachedTemplate
e7489e88-ec82-ff16-558b-1dd5470f83c9
06/08/2017
medium

Document.AttachedTemplate property (Word)

Returns a Template object that represents the template attached to the specified document. Read/write Variant.

Syntax

expression. AttachedTemplate

expression A variable that represents a Document object.

Remarks

To set this property, specify either the name of the template or an expression that returns a Template object.

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"

See also

Document Object

[!includeSupport and feedback]