Project.FullName property (Project)

Gets the path and file name of a project. Read-only String.

Syntax

expression.FullName

expression A variable that represents a Project object.

Remarks

The FullName property returns the project name (as seen in the title bar) for an unsaved project.

Example

The following example prompts the user for the full name of a file and then closes the file, saving it if it has changed.

Sub CloseFile() 
 Dim P As Project ' Project object used in For Each loop 
 Dim FileName As String ' Full name of a file 
 
 ' Prompt user for the full name of a file. 
 FileName = InputBox$("Close which file? Include its path: ") 
 
 ' Search the open projects for the file. 
 For Each P In Application.Projects 
 
 ' If the file is found, close it. 
 If P.FullName = FileName Then 
 P.Activate 
 FileClose pjSave 
 Exit Sub 
 End If 
 Next P 
 
 ' Inform user if the file is not found. 
 MsgBox ("Could not find the file " & FileName & ".") 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.