Add method (Documents collection)
Adds a new Document object to the Documents collection.
Version added
2.0
Syntax
| |
docObj |
The new Document object added to the Documents collection. |
object |
Required. An expression that returns a Documents collection. |
fileName |
Required String. The type or file name of object to add; if you don't include a path, Visio searches folders designated in the Application object's TemplatePaths property. |
Remarks
To create a new drawing based on no template, pass a zero-length string ("") to the Add method.
To create a new drawing based on a template, pass "templatename.vst" to the Add method. Visio opens stencils that are part of the template's workspace and copies styles and other settings associated with the template to the new document. If the template file name is invalid, no document is returned and an error is generated.
To create a new stencil based on no stencil, pass ("vss").
To open a copy of a stencil, pass ("stencilname.vss").
To open a copy of a drawing, pass ("drawingname.vsd").
Note Opening a copy of a stencil or drawing is equivalent to selecting Copy in the Open list box of the Open dialog box or using the OpenEx method with the visOpenCopy flag.