Document.AttachedTemplate Property (2007 System)
Gets or sets a Template that represents the template attached to the document.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public Property AttachedTemplate As Object
'Usage
Dim instance As Document
Dim value As Object
value = instance.AttachedTemplate
instance.AttachedTemplate = value
[BrowsableAttribute(false)]
public Object AttachedTemplate { get; set; }
[BrowsableAttribute(false)]
public:
property Object^ AttachedTemplate {
Object^ get ();
void set (Object^ value);
}
public function get AttachedTemplate () : Object
public function set AttachedTemplate (value : Object)
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.
This example is for a document-level customization.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.