Software Developer's Kit - ChemDraw

Send comments on this topic
FilterByTagString Method
See Also 
tagName
Object tag name by which to filter.
tagValue
String value by which to filter.
includeThese
Indicates whether these objects should be included or not.
pVal
Collection of objects returned after applying filter.  

Description

Member of ChemDrawControl.Objects.

Return the collection of these objects that have an Object Tag of the specified name and value

Syntax

Visual Basic
Public Sub FilterByTagString( _
   ByVal tagName As String, _
   ByVal tagValue As String, _
   ByVal includeThese As Boolean, _
   ByVal pVal As Objects _
) 

Parameters

tagName
Object tag name by which to filter.
tagValue
String value by which to filter.
includeThese
Indicates whether these objects should be included or not.
pVal
Collection of objects returned after applying filter.  

Remarks

   Return the collection of these objects that have an Object Tag of the specified name and value.

Example

'Declare variables
 Dim vName As String
 Dim vObjectTag As ChemDrawControl11Ctl.ObjectTag

 Private Sub cmdCreateObjectTag_Click()
     vName = "ObjectTagName"
     ChemDrawCtl1.selection.Objects.Item(1).MakeObjectTag vName, vObjectTag, False
     vObjectTag.StringValue = varString
     vObjectTag.Persistent = False
     vObjectTag.Caption.Text = "New Value"
     vObjectTag.Caption.Family = "Arial"
     vObjectTag.Color = vbBlue
 End Sub

 Private Sub cmdFilterByTag_Click()
     vName = "ObjectTagName1"
     Dim myObjects1 As ChemDrawControl11Ctl.Objects
     Dim myObjects2 As ChemDrawControl11Ctl.Objects
     Set myObjects1 = Me.ChemDrawCtl1.Objects 
     'myObjects1: objects to be filtered, myObjects2: objects returned after filter
     myObjects1.FilterByTag vName, TagValue, True, myObjects2
     Text1.Text = "In: " & myObjects1.Count & " Out: " & myObjects2.Count
 End Sub

See Also