DocumentBase.AttachedTemplate Property

Gets or sets a Template that represents the template attached to the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

'Declaration
Public Property AttachedTemplate As Object
public Object AttachedTemplate { get; set; }

Property Value

Type: System.Object
A Template that represents the template attached to the document.

Remarks

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

Examples

The following code example displays a message that shows the name of the template that is attached to the document. To use this example, run it from the ThisDocument class in a document-level project.

Private Sub DocumentAttachedTemplate()
    Dim attachedTemplate As Word.Template = CType(Me.AttachedTemplate, Word.Template)
    MessageBox.Show(attachedTemplate.Name)
End Sub
private void DocumentAttachedTemplate()
{
    Word.Template attachedTemplate = (Word.Template)this.AttachedTemplate;
    MessageBox.Show(attachedTemplate.Name);
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace