Adding globally unique identifiers to shapes

Started by Visisthebest, August 07, 2018, 11:50:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

We have a need to put a globally unique identifier on each shape created, in particular for diagram compares (so we know if this is a changed shape or a newly added shape that happens to have the same label). Global meaning here: virtually certain to be unique regardless of who generated it where on whatever system at whatever time.

We prefer globally unique identifiers that are basically meaningless and contain no information, so I was thinking of the classic GUID.

Is this still a best practice for globally unique identifiers that need to be meaningless and contain no real information, or is there something that has replaced it?

Also what is the recommended way to create GUIDs in VBA in Visio? There is a lot of old vba code to be found for VBA GUID generation but is it still best practice?

Your GUID guidance is much appreciated!
Visio 2021 Professional

AndyW

The Visio shape has a method for a GUID, .UniqueID and can be passed visGetOrMakeGUID, visGetGUID or visDeleteGUID.

The unique id is not set as a mater of course, it is upto you to call the code to make the GUID.

Live life with an open mind

Visisthebest

Visio 2021 Professional