Word (的 Document.AttachedTemplate 屬性)
會傳回 Template 物件,代表附加至指定檔的範本。 讀取/寫入的 Variant。
語法
expression。 AttachedTemplate
表達 代表 Document 物件的變數。
註解
若要設定這個屬性,請指定範本名稱,或是會傳回 Template 物件的運算式。
範例
本範例會顯示貼附至使用中文件裡範本的名稱及路徑。
Set myTemplate = ActiveDocument.AttachedTemplate
MsgBox myTemplate.Path & Application.PathSeparator _
& myTemplate.Name
本範例會在文件 1 的開頭插入特殊圖文集 (內建自動圖文集項目) 的內容。
Set myRange = Documents(1).Range(0, 0)
Documents(1).AttachedTemplate.AutoTextEntries("Spike") _
.Insert myRange
本範例會將範本 "Letter.dot" 貼附至使用中文件。
ActiveDocument.AttachedTemplate = "C:\Templates\Letter.dot"
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。