返回从中创建文档的模板的名称。 此为只读属性。
语法
表达式。模板
表达 一个代表 Document 对象的变量。
返回值
String
备注
如果文档未基于任何模板,则 Template 属性返回一个空字符串 (''")。
示例
以下 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用 Template 属性获取从中创建文档的模板的名称。
Public Sub Template_Example()
Dim strTemplateName As String
strTemplateName = ThisDocument.Template
'Verify that the proper string was returned.
Debug.Print strTemplateName
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。