Edit

Bagikan melalui


Template Interface

Definition

Represents a document template.

public interface class Template
[System.Runtime.InteropServices.Guid("0002096A-0000-0000-C000-000000000046")]
public interface Template
type Template = interface
Public Interface Template
Attributes

Remarks

The Template object is a member of the Templates collection. The Templates collection includes all the available Template objects.

Use Templates(index), where index is the template name or the index number, to return a single Template object. The index number represents the position of the template in the Templates collection.

The Add method isn't available for the Templates collection. Instead, you can add a template to the Templates collection by doing any of the following:

Use the NormalTemplate property to return a template object that refers to the Normal template. Use the AttachedTemplate property to return the template attached to the specified document.

Use the DefaultFilePath[WdDefaultFilePath] property to return or set the location of user or workgroup templates (that is, the folder where you want to store these templates).

Properties

Application

Returns a Application object that represents the Microsoft Word application.

AutoTextEntries

Returns a AutoTextEntries collection that represents all the AutoText entries in the specified template.

BuildingBlockEntries

Returns a BuildingBlockEntries collection that represents the collection of building block entries in a template. Read-only.

BuildingBlockTypes

Returns a BuildingBlockTypes collection that represents the collection of building block types that are contained in a template. Read-only.

BuiltInDocumentProperties

Returns a DocumentProperties collection that represents all the built-in document properties for the specified document.

Creator

Returns a 32-bit integer that indicates the application in which the specified object was created.

CustomDocumentProperties

Returns a DocumentProperties collection that represents all the custom document properties for the specified document.

FarEastLineBreakLanguage

Returns or sets the East Asian language to use when breaking lines of text in the specified document or template.

FarEastLineBreakLevel

Returns or sets the line break control level for the specified document.

FullName

Specifies the name of a template, including the drive or Web path.

JustificationMode

Returns or sets the character spacing adjustment for the specified template.

KerningByAlgorithm

True if Microsoft Word kerns half-width Latin characters and punctuation marks in the specified document.

LanguageID

Returns or sets the language for the specified object.

LanguageIDFarEast

Returns or sets an East Asian language for the specified object.

ListTemplates

Returns a ListTemplates collection that represents all the list formats for the specified template.

Name

Returns or sets the name of the specified object.

NoLineBreakAfter

Returns or sets the kinsoku characters after which Microsoft Word will not break a line.

NoLineBreakBefore

Returns or sets the kinsoku characters before which Microsoft Word will not break a line.

NoProofing

True if the spelling and grammar checker ignores documents based on this template.

Parent

Returns an object that represents the parent object of the specified object.

Path

Returns the disk or Web path to the specified object.

Saved

True if the specified document or template hasn't changed since it was last saved. False if Microsoft Word displays a prompt to save changes when the document is closed.

Type

Returns the template type.

VBProject

Returns the VBProject object for the specified template.

Methods

OpenAsDocument()

Opens the specified template as a document and returns a Document object.

Save()

Saves the specified document or template.

Applies to