DocumentBase.AttachedTemplate 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个表示附加到文档的模板的 Template。
public object AttachedTemplate { get; set; }
属性值
一个表示附加到文档的模板的 Template。
示例
下面的代码示例显示一条消息,该消息显示附加到文档的模板的名称。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
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
注解
若要设置此属性,请指定模板的名称或返回的表达式 Template 。