Documents.Add Method 

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

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Dim Template As Object
Dim NewTemplate As Object
Dim DocumentType As Object
Dim Visible As Object
Dim returnValue As Document
Dim documents1 As Documents
returnValue = documents1.Add(Template, NewTemplate, DocumentType, Visible)

Syntax

Function Add( _
    <InAttribute()> Optional ByRef Template As Object, _
    <InAttribute()> Optional ByRef NewTemplate As Object, _
    <InAttribute()> Optional ByRef DocumentType As Object, _
    <InAttribute()> Optional ByRef Visible As Object _
) As Document
Document Add(
    [In, Optional] ref object Template, 
    [In, Optional] ref object NewTemplate, 
    [In, Optional] ref object DocumentType, 
    [In, Optional] ref object Visible
);
public: Document^ Add(
    &Object^ Template, 
    &Object^ NewTemplate, 
    &Object^ DocumentType, 
    &Object^ Visible
);
public Document Add(
    /*in*/System.Object Template, 
    /*in*/System.Object NewTemplate, 
    /*in*/System.Object DocumentType, 
    /*in*/System.Object Visible
);
function Add(
     Template : Object, 
     NewTemplate : Object, 
     DocumentType : Object, 
     Visible : Object
) : Document;

Parameters

  • Template
    Optional Object. The name of the template to be used for the new document. If this argument is omitted, the Normal template is used.
  • NewTemplate
    Optional Object. True to open the document as a template. The default value is False.
  • DocumentType
    Optional Object. Can be one of the following WdNewDocumentType constants: wdNewBlankDocument, wdNewEmailMessage, wdNewFrameset, or wdNewWebPage. The default constant is wdNewBlankDocument.
  • Visible
    Optional Object. 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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Documents Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

Documents Members