Add Method (Documents Collection)

Applies To

Documents collection object.

Description

Adds a new, empty document to the collection of open documents.

Syntax

expression.Add(Template, NewTemplate)

expression Required. An expression that returns a Documents object.

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.

See Also

AttachedTemplate property, Templates property.

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 in Windows.

Documents.Add Template:= _
    "C:\Program Files\Microsoft Office\Templates\Memos\Professional Memo.dot"
This example creates a new document based on the Professional Memo template on the Macintosh.

Documents.Add Template:= _
    "Macintosh HD:Microsoft Office:Templates:Memos:Professional Memo"
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