Software Developer's Kit - ChemDraw

Send comments on this topic
Persistent Property
See Also 

Description

Member of ChemDraw Control.ObjectTag.

Sets and returns whether the ObjectTag will be preserved when the document is saved.

Property type

Read-write property

Syntax

Visual Basic
Public Property Persistent() As Boolean

Return Type

Boolean

Remarks

If myObjectTag.Persistent = False (default) means that the ObjectTag will not be saved with the document.

If myObjectTag.Persistent = True means that the ObjectTag will be saved with the document.

Example

'Shows example of persistent property
 Dim myObjectTag as ChemDrawControl10Ctl.ObjectTag
 Dim myObject as ChemDrawControl10Ctl.Object
 Dim vName as string

 Private Sub Load_ObjectTag_Click()
    If  myObjectTag is Nothing Then
        vMessage = MsgBox(“No ObjectTag is loaded”, vbCritical + vbOKOnly, “Error”)
        vName = “Name_of_ObjectTag”
        ‘Makes an ObjectTag
        myObject.MakeObjectTag vName, myObjectTag, True
        ‘ObjectTag must be visible
        myObjectTag.Visible = True
        ‘Assigns the content of vString to the ObjectTag.StringValue 
        myObjectTag.StringValue = vString
        ‘With Persistent = True the ObjectTag will be saved when the file is saved
        myObjectTag.Persistent = True 
    End If
End Sub

See Also