Table of contents
Collapse the table of content
Expand the table of content

Master.UniqueID Property (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Returns the unique ID of a master. Read-only.


expression . UniqueID

expression An expression that returns a Master object.

Return Value



A Master object always has a unique ID. If you copy a master, the new master has the same unique ID as the original master (as well as the same base ID). However, if you subsequently change the copy, Visio assigns it a new unique ID, but its base ID remains the same.

Note that if you copy into a stencil a master that has the same unique ID as a master already in the stencil, Visio assigns a new unique ID to the copy.

For more information about the base ID, see the BaseID property.

You can determine a Master object's unique ID by using the following code:

strID = vsoMaster.UniqueID

The value it returns is a string in the following form:


To get a master if you know its unique ID, use Masters.Item ( UniqueIDString) .

For example, you can use the following code to retrieve the master from the Masters collection of the active document:

Dim vsoMaster As Visio.Master 
Set vsoMaster = Visio.ActiveDocument.Masters("{0478DA94-1315-9876-8E4C-006523ABC9B2}") 

Alternatively, you can use the following code, which adds the letter "U" before the string to identify it as a unique ID:

Dim vsoShape As Visio.Shape 
Set vsoMaster = Visio.ActiveDocument.Masters("U{0478DA94-1315-9876-8E4C-006523ABC9B2}") 
© 2018 Microsoft