Import Method

Imports a file of one of the formats, supported by ConceptDraw. Returns an instance of the Document object corresponding to the imported file.

Applies to: Application object

Syntax

[[Set] docRet =] object.Import ( fileName, formatType, [showSaveDlg], [showSettingsDlg] )

The Import method syntax has these parts:

Part Description
object Required. An expression, that returns an instance of the Application object.
fileName Required. An expression that returns a String value. Represents the name of the imported file.
formatType Required. An expression that returns a Long value. Indicates the format of the imported file. This parameter must be equal to one of the pre-defined constants, which correspond the the file formats supported by ConceptDraw. If the format is indicated incorrectly, it is recognized automatically for raster files. For vector files format is not recognized.
showSaveDlg Optional. An expression that returns a Boolean value. A flag that specifies whether to display the file open dialog. The default value is False.
showSettingsDlg

Optional. An expression that returns a Boolean value. A flag that specifies whether to display the import settings dialog for some file formats. This parameter is needed for the file formats, which can not be imported without information about their contents (for instance, which delimiter is used, etc). For example, such formats are Outline and Flowdata. When this flag is False the import settings are taken from the application settings which you can view and modify by choosing "Edit > Preferences". The defaut value is False.

docRet Optional. A Document type variable.

Remarks

If the format of the imported file is specified as cdf_UNKNOWN (unknown file format) or set incorrectly, ConceptDraw tries to recognized the format automatically (except for the Outline and FlowData formats). If the file was imported successfully, tje Import method returns a reference to the instance of the Document object, which corresponds to the imported file. If the specified file couldn't be opened, the Import method returns Nothing.

The list of formats, supported in ConceptDraw and corresponding ConceptDraw Basic constants can be seen here.

The inverse method to Import is the Export method which saves a ConceptDraw document in a file with the specified format.

Example

This example contains application-level script.

thisApp.Import( "c:\ffffff.bmp", cdf_BMP, TRUE, TRUE )

 

See Also

Import/Export constants, Export method, Document object