Software Developer's Kit - ChemDraw

Send comments on this topic
SaveAs Method
See Also 
Filename
Name of file to be saved.
Format
The format of the file to be saved.
resolution
Resolution of the file to be saved.
Width
Number of pages wide to be saved.
Height
Number of pages high to be saved.

Description

Member of ChemDrawCtl.

Saves changes to a file.

Syntax

Visual Basic
Public Sub SaveAs( _
   Optional ByRef Filename As Variant, _
   Optional ByRef Format As Variant, _
   Optional ByRef resolution As Variant, _
   Optional ByRef Width As Variant, _
   Optional ByRef Height As Variant _
) 

Parameters

Filename
Name of file to be saved.
Format
The format of the file to be saved.
resolution
Resolution of the file to be saved.
Width
Number of pages wide to be saved.
Height
Number of pages high to be saved.

Example

Private Sub ctlChemDraw_SelectionChanged(ByVal selection _
        As ChemDrawControl10Ctl.IChemDrawSelection)
    If  selection.documents.Count = 1 Then
        Set MyDocument = ctlChemDraw.selection.Objects.Documents.Item(1)
        Label1.Caption = "Object: Document"
    End If
End Sub

Private Sub cmdSaveAs_Click()
    'ctlChemDraw.ActiveDocument.SaveAs "c:\NameOfFile.cdx", cdx
    Dim vDocument As Document
    Set vDocument = ctlChemDraw.ActiveDocument 
    'variables must cleared for this to work
    ChemDrawCtl.SaveAs CurDir() & "\filename.cdx", cdx
    Text1 = vDocument.FullName
    vDocument.Close
    Set vDocument = Nothing
End Sub

See Also