Customization > Automation Interface > Functions > For Modeler Items > Functions for Properties > Setting and returning the value of an object attribute (automation interface)
Setting and returning the value of an object attribute (automation interface)
We recommend that you set the value of an object attribute through the following syntax:
<object>("<attribute>") = "<value>"
We recommend that you return the value of an object attribute through the following syntax:
<object>("<attribute>")
Where:
<object> is an object that specifies the object whose attribute is being set or read. For more information, see Identifying objects.
<attribute> is a string that specifies the name of the object attribute that is being set or read. For more information, see Identifying attributes.
<value> is a string that specifies the value that is being set for the object attribute.
Notes
You can use an association name instead of an attribute name to return the default attribute (typically the Name) of the first item that is associated through the chosen association.
If when attempting to set an attribute value you encounter an error message, you can find out more information about the problem through the ExtendedErrorInfo property. For more information about the ExtendedErrorInfo, see Finding Out More Information About an Error.
Examples
This example sets the Description property of Class1 to 'Description of Class1'.
Set objItem = Dictionary.Item("Class", "Class1")
objItem("Description") = "Description of Class1"
This example displays the Description property of Class1.
Set objItem = Dictionary.Item("Class", "Class1")
strMessage = objItem("Description")
Call Msgbox(strMessage)