Open method (Documents collection)

Microsoft Visio Developer Reference

Open method (Documents collection)

       

Opens an existing file so it can be edited.

Version added

2.0

Syntax

docObjRet = docsObj.Open (fileName)

docObjRet

A Document object that represents the file that was opened.

docsObj

Required. An expression that returns the Documents collection to receive the opened file.

fileName

Required String. The name of a file to open.

Remarks

When you use the Open method to open a Document object, it opens a Visio file as an original. Depending on the file extension, the Open method opens a drawing (.vsd), a stencil (.vss), a template (.vst), a workspace (.vsw), an XML drawing (.vdx), an XML stencil (.vsx), or an XML template (.vtx). You can also open and convert non–Visio files to Visio files using this method. If the file does not exist or the file name is invalid, no Document object is returned and an error is generated.

If a valid stencil (.vss) file name is passed, the original stencil file is opened, which means you can edit its masters. Unless you want to create or edit the masters, open a stencil as read-only through an associated template or by using the OpenEx method.