Name Property

Home Page (Objects)OverviewFAQReference

Applies to: Application object, Configuration object, Document object, Project object, TextDocument object

Gets the name of an object.

Syntax

object.Name

-or-

object

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above. When you access the Name property of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods. Additionally, the Name property is the default property of all objects in the Applies To list. Accordingly, you do not have to reference Name explicitly, as shown in the syntax.

Remarks

The Name property has the String type.

The following table summarizes the results of using the Name property with the objects in the Applies To list:

Object Results
Application Gets the name of the application.
Configuration Gets the name of the current configuration, for example
"MyProject - Win32 Debug."
Document Gets the name of the current document, for example
"MyFile.cpp."
Project Gets the name of the current project, for example "MyProject."
TextDocument Gets the name of the current text document, for example "MyFile.cpp."

The Name property does not get a document's drive and directory. To get the drive and directory, use the Path or FullName property.

Example

The following example gets the name of the active document:

ActiveDocument.Name

See Also   FullName property.