UniqueID property (Shape object)

UniqueID property (Shape object)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

See also         Example         Applies to

Returns or clears the unique ID of a shape.

Version added

4.0

Syntax

        
          strRet = object.UniqueID(flag)
      

strRet

String. The unique ID of the Shape object.

object

Required. An expression that returns a Shape object.

flag

Required Integer. Gets, assigns, or clears the unique ID of a Shape object.

Remarks

By default, a shape does not have a unique ID. A shape acquires a unique ID only if you set its UniqueID property.

If a Shape object has a unique ID, no other shape in any other document will have the same ID.

The flag argument controls the behavior of the UniqueID property. It should have one of the following values.

Constant

Value

visGetGUID

0

visGetOrMakeGUID

1

visDeleteGUID

2

The constant visGetGUID returns the unique ID string only if the shape already has a unique ID. Otherwise it returns a zero-length string ("").

The constant visGetOrMakeGUID returns the unique ID string of the shape. If the shape does not yet have a unique ID, it assigns one to the shape and returns the new ID.

The constant visDeleteGUID clears the unique ID of a shape and returns a zero-length string ("").

You can access a shape with its unique ID using Shapes.Item(uniqueIDString).