Path Property

Home Page (Objects)OverviewFAQReference

Applies to: Application object, Document object, TextDocument object

Gets the path to an object. This path never ends with a backslash, unless the path has the format "C:\."

Syntax

object.Path

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above. When you access the Path 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.

Remarks

The Path property has the String type.

The Path property does not get an object's file name and extension. To get the file name and extension, use the Name or FullName property.

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

Object Results
Application Gets the path to the Developer Studio executable, for example: "C:\Program files\Microsoft Visual Studio\Common\MSDEV98\bin."
Document

TextDocument



Gets the path to the file containing the document, for example: "C:\Mydocuments."

The Path property does not end the path with a backslash, unless the path has the format "C:\."

Example

The following example gets the path to the active document:

Dim PathString
PathString = ActiveDocument.Path