OpenDoc Method

Opens an existing ConceptDraw document.

Applies to: Application object

Syntax

[[Set documentRet =] object.OpenDoc ( fileName )

The OpenDoc method syntax has these parts:

Part Description
object Required. An expression, that returns an instance of the Document object.
fileName Required. An expression that returns a String value. Contains the name of the document file including the full or relative path.
documentRet Optional. A Document type variable.

Remarks

The OpenDoc method attempts to open the specified file as one of the ConceptDraw files, to which the following file formats belong:

Extention File Type (for Mac) CDBasic constant Description
"cdd" 'cdda' cdf_CDD ConceptDraw V Document
"cdd" 'cdda' cdf_CDD1X ConceptDraw 1.x Document
"cdl" 'cddc' cdf_CDL ConceptDraw V Library
"cdl" 'cddc' cdf_CDL1X ConceptDraw 1.x Library
"cdx"   cdf_CDX XML for ConceptDraw
"cdw" 'cddd' cdf_CDW ConceptDraw V Workspace
"cdw" 'cddd' cdf_CDW1X ConceptDraw 1.x Workspace

If the document has been opened successfully, the OpenDoc method returns an instance of the Document object, that corresponds to the opened document. If the file with the specified name doesn't exist, or doesn't match one of the file formats, listed above, the OpenDoc method returns Nothing.

Example

This example contains a application-level script. The script imitates the way the "File->Open" menu item of ConceptDraw works.

Dim str As String          ' Declare string variable
str = GetOpenFileName ()   ' Display file open dialog 
                           ' and get the filename
thisApp.OpenDoc( str )     ' Attempt to open the chosen file

 

See Also

CloseDoc method, CreateNewDoc method, Doc method, DocByName method, DocsNum method, FirstDoc method, NextDoc method, Document object, Import/Export constants