Find Method
Description
Searches for objects in the specified picture and returns the search result as a collection object.
You can search for the following object properties:
● Type
● Name
● Property
syntax
Expression.
Find([ObjectType], [ObjectName], [PropertyName])
Expression
Necessary. An expression or element which returns an object of the "HMIObjects" type.
Parameters
You must specify at least one of the three parameters.
Parameter (Data Type) Description
ObjectType (String) The object type that is to be searched for. Specify
the "ProgID" of the object concerned. "Obtain the
"ProgID" by prefixing the VBA object name with
"HMI" "(e.g. HMICircle or HMIRectangle)
ObjectName (String) The name of the object that is to be searched for.
You
can use placeholders (?,*) in the object name
in order to find objects with similar names.
PropertyName (String) The name of the object property that is to be
searched for. Specify the VBA property name
concerned (e.g. "BackColor" in place of
"Background Color").
Example:
In the following example, objects of the "HMICircle" type will be searched for in the active
picture and the search result will be output:
Sub FindObjectsByType()
'VBA153
Dim colSearchResults As HMICollection
Dim objMember As HMIObject
Dim iResult As Integer
Dim strName As String
VBA for Automated Configuration
4.4 The object model of the Graphics Designer
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
System Manual, 11/2008,
1755