GetNamesU Method [Visio 2003 SDK Documentation]
As it applies to the Addons collection.
Returns the universal names of all items in an Addons collection.
object**.GetNamesU**(NameArray())
object Required. An expression that returns a collection from the Applies to list.
NameArray Required String. Array that receives names of members of the indicated object.
Version added
4.5
Remarks
If the GetNamesU method succeeds, NameArray returns a one-dimensional array of n strings indexed from 0 to n - 1, where n equals the Count property of the object. NameArray is an out argument that is allocated by the GetNamesU method, which passes ownership back to the caller. The caller should eventually perform the SafeArrayDestroy procedure on the returned array. Note that the SafeArrayDestroy procedure has the side effect of freeing the strings referenced by the array's entries. (Microsoft Visual Basic and Visual Basic for Applications take care of this for you.)
Note Beginning with Microsoft Visio 2000, you can use both local and universal names to refer to Visio shapes, masters, documents, pages, rows, add-ons, cells, hyperlinks, styles, fonts, master shortcuts, UI objects, and layers. When a user names a shape, for example, the user is specifying a local name. Beginning with Microsoft Office Visio 2003, the ShapeSheet spreadsheet displays only universal names in cell formulas and values. (In prior versions, universal names were not visible in the user interface.)
As a developer, you can use universal names in a program when you don't want to change a name each time a solution is localized. Use the GetNames method to get the local name of more than one object. Use the GetNamesU method to get the universal name of more than one object.
As it applies to the Masters, MasterShortcuts, Pages, and Styles collections.
Returns the universal names of all items in aMasters, MasterShortcuts,Pages, or Styles collection.
object**.GetNamesU**(localeIndependentNameArray())
object Required. An expression that returns a collection from the Applies to list.
localeIndependentNameArray Required String. Array that receives names of members of the indicated object.
Version added
4.5
Remarks
If the GetNamesU method succeeds, localeIndependentNameArray returns a one-dimensional array of n strings indexed from 0 to n - 1, where n equals the Count property of the object. The localeIndependentNameArray argument is an out argument that is allocated by the GetNamesU method, which passes ownership back to the caller. The caller should eventually perform the SafeArrayDestroy procedure on the returned array. Note that the SafeArrayDestroy procedure has the side effect of freeing the strings referenced by the array's entries. (Microsoft Visual Basic and Visual Basic for Applications take care of this for you.)
Note Beginning with Microsoft Visio 2000, you can use both local and universal names to refer to Visio shapes, masters, documents, pages, rows, add-ons, cells, hyperlinks, styles, fonts, master shortcuts, UI objects, and layers. When a user names a shape, for example, the user is specifying a local name. Beginning with Microsoft Office Visio 2003, the ShapeSheet spreadsheet displays only universal names in cell formulas and values. (In prior versions, universal names were not visible in the user interface.)
As a developer, you can use universal names in a program when you don't want to change a name each time a solution is localized. Use the GetNames method to get the local name of more than one object. Use the GetNamesU method to get the universal name of more than one object.
Example
As it applies to the Masters collection.
The following macro shows how to use the GetNamesU method to get the names of all the Master objects in the Masters collection of the active document and print them in the Immediate window.
Public Sub GetNamesU_Example()
Dim strMasterNames() As String
Dim intLowerBound As Integer
Dim intUpperBound As Integer
ActiveDocument.Masters.GetNamesU strMasterNames
intLowerBound = LBound(strMasterNames)
intUpperBound = UBound(strMasterNames)
Debug.Print ActiveDocument; " Lower bound:"; intLowerBound; "Upper bound:"; intUpperBound
While intLowerBound <= intUpperBound
Debug.Print strMasterNames (intLowerBound)
intLowerBound = intLowerBound + 1
Wend
End Sub
Applies to | Addons collection | Masters collection | MasterShortcuts collection | Pages collection | Styles collection