Software Developer's Kit - ChemDraw

Send comments on this topic
Open Method
See Also 
Filename
Indicates the name of the document to be opened.
password
Indicates the password, if any, of the document to be opened.
Format
Indicates the format of the document to be opened.

Description

Member of ChemDraw Control.Documents.

Opens an existing document.

Syntax

Visual Basic
Public Function Open( _
   ByVal Filename As String, _
   Optional ByRef password As Variant, _
   Optional ByRef Format As Variant _
) As Document

Parameters

Filename
Indicates the name of the document to be opened.
password
Indicates the password, if any, of the document to be opened.
Format
Indicates the format of the document to be opened.

Return Type

Remarks

This method opens an existing document.

Example

'Declares variables 
 Dim myDocuments As ChemDrawControl11Ctl.Documents
 Set myDocuments = ctlChemDraw.Selection.Objects.Documents

 Private Sub cmdOpen_Click() 
    'opens and sets document
     myDocuments.Item(1).Open CurDir() & "\FileName.cdx", False
     Set myDocuments.Item(1) = ctlChemDraw.ActiveDocument
 End Sub

See Also