Documents.Add Method
Word Developer Reference |
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.
Visual Basic for Applications |
---|
|
This example creates a new document based on the Professional Memo template.
Visual Basic for Applications |
---|
|
This example creates and opens a new template, using the template attached to the active document as a model.
Visual Basic for Applications |
---|
|
See Also