Description

Changes an McObject's name, or assigns a name to an unnamed McObject.

Return Type

None  

Syntax

object.ChangeObjectName pimcobjectToName, bstrName, [bstrNamespace]

The ChangeObjectName Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McObjects.
pimcobjectToNameRequired. An Unknown object.

The McObject* of the McObject to rename.

bstrNameRequired. A String value.

New name for the object. This name must be globally unique within its Namespace for all objects sharing the same parent McObject. Use the CheckForLegalName method to check a name for legal syntax and collisions.

bstrNamespaceOptional. A String value.

Optional namespace for the object name, or NULL or empty to use the default Namespace (see the Namespace property, and the Item method). Supply a value of “::” to specify the global namespace, irrespective of the current default Namespace property. However, namespaces that you use should generally start with “McOM”.

Remarks

Both the name and namespace of an object can be changed with this method, but the parent object cannot be changed (names must be unique for all objects sharing the same parent object).

You cannot change the name of an McObject if the mcobjUserFlagSystemObject bit in the UserFlag property is set.