Name Property

Applies To   See Also

Specifies the name used to reference an object in code. Available at design time; read-write at run time.

Syntax

Object.Name[ = cName]

Settings

cName

Specifies the name used to reference the object in code.

Remarks

The default name for new objects is the type of object plus a unique integer. For example, the first new Form object is Form1, and the third text box you create on a Form is Text3.

Note   If the object is the first object in the object hierarchy (that is, the outermost container object), use the object variable to reference the object instead of the Name property.

For a Project object, the Name property contains the name and path to the project, and is read-only at design time and run time.

For a File object, the Name property contains the name and path to the file, and is read-only at design time and run time.