Customization > Automation Interface > Functions > Functions for Projects > FindObject function (automation interface)
FindObject function (automation interface)
Syntax:
FindObject("<id>")
Where:
<id> is a string that specifies the Id of the object to find.
The FindObject function returns an object in a model searching on an "Id" index. You can use this function with the Project object only. If the object does not exist the function generates an error.
FindObject uses the Id as an index, making it faster. The Id of an object is permanent.
Examples
This example finds a Class named DDIT through its Id and then displays its name:
Set objToFind = Dictionary.Item("Class","DDIT")
strID = objToFind.Property("Id")
Set objFound = ActiveProject.FindObject(strID)
Call Msgbox(objFound.Property("Name"))