DocumentBase.AttachedTemplate Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a Template that represents the template attached to the document.
public:
property System::Object ^ AttachedTemplate { System::Object ^ get(); void set(System::Object ^ value); };
public object AttachedTemplate { get; set; }
member this.AttachedTemplate : obj with get, set
Public Property AttachedTemplate As Object
Property Value
A Template that represents the template attached to the document.
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 void DocumentAttachedTemplate()
{
Word.Template attachedTemplate = (Word.Template)this.AttachedTemplate;
MessageBox.Show(attachedTemplate.Name);
}
Private Sub DocumentAttachedTemplate()
Dim attachedTemplate As Word.Template = CType(Me.AttachedTemplate, Word.Template)
MessageBox.Show(attachedTemplate.Name)
End Sub
Remarks
To set this property, specify either the name of the template or an expression that returns a Template.