The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

How to: Create New Documents


Some code examples in this topic use the this or Me keyword or the Globals class in a way that is specific to document-level customizations, or they rely on features of document-level customizations such as host controls. These examples can be compiled only if you have the required applications installed. For more information, see Features Available by Product Combination.

When you create a new Microsoft Office Word 2003 document, you add it to the Documents collection of open Word documents. Consequently, the Add method creates a new Word document. This is the same as clicking the New Blank Document button on the toolbar. However, since you are creating the document programmatically, it is a native Microsoft.Office.Interop.Word.Document object and does not have the additional events and data binding capabilities of a Microsoft.Office.Tools.Word.Document host item. You cannot programmatically add Microsoft.Office.Tools.Word.Document host items to your project. For more information, see Programmatic Limitations of Host Items and Host Controls.

To create a new document based on

  • Use the Add method of the Documents collection to create a new document based on

    this.Application.Documents.Add(ref missing, ref missing, ref missing, ref missing);

Using Custom Templates

The Add method has an optional Template argument to create a new document based on a template other than You must supply the file name and fully qualified path where the template is located.


This code achieves the same result as a user choosing New from the File menu and choosing a template from the New Document toolbar.

To create a new document based on a custom template

  • Call the Add method of the Documents collection and specify the path to the template.

    object template = @"C:\Test\"; 
    this.Application.Documents.Add(ref template, ref missing, ref missing, ref missing);

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft