GetNames[U] method

Microsoft Visio Developer Reference

GetNames[U] method

See also       

Returns the names of all items in a Documents, Pages, Masters, Styles, or Addons collection.

Version added

4.5

Syntax

object.GetNames 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.

Remarks

If the GetNames 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 GetNames 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. The GetNames method fails if called with !nameArray or nameArray. (Microsoft Visual Basic and Visual Basic for Applications take care of this for you.)

Note Beginning with Visio 2000, you can refer to Visio shapes, masters, styles, pages, rows, and layers using local and universal names. When a user names a shape, for example, the user is specifying a local name. Universal names are not visible through 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 more than one object's local name. Use the GetNamesU method to get more than one object's universal name.