Partager via


Documents.Add Method (Word)

Returns a Document object that represents a new, empty document added to the collection of open documents.

Syntax

expression .Add(Template, NewTemplate, DocumentType, Visible)

expression Required. A variable that represents a Documents collection.

Parameters

Name

Required/Optional

Data Type

Description

Template

Optional

Variant

The name of the template to be used for the new document. If this argument is omitted, the Normal template is used.

NewTemplate

Optional

Variant

True to open the document as a template. The default value is False.

DocumentType

Optional

Variant

Can be one of the following WdNewDocumentType constants: wdNewBlankDocument, wdNewEmailMessage, wdNewFrameset, or wdNewWebPage. The default constant is wdNewBlankDocument.

Visible

Optional

Variant

True to open the document in a visible window. If this value is False, Microsoft Word opens the document but sets the Visible property of the document window to False. The default value is True.

Return Value

Document

Example

This example creates a new document based on the Normal template.

Documents.Add

This example creates a new document based on the Professional Memo template.

Documents.Add Template:="C:\Program Files\Microsoft Office" _ 
 & "\Templates\Memos\Professional Memo.dot"

This example creates and opens a new template, using the template attached to the active document as a model.

tmpName = ActiveDocument.AttachedTemplate.FullName 
Documents.Add Template:=tmpName, NewTemplate:=True

See Also

Concepts

Documents Object Members

Documents Collection Object