Project.FullName Property

Project Developer Reference

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



expression   A variable that represents a Project object.

Return Value


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

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

Visual Basic for Applications
  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.<strong class="bterm">FullName</strong> = FileName Then
        FileClose pjSave
        Exit Sub
    End If
Next P

' Inform user if the file is not found.
MsgBox ("Could not find the file " &amp; FileName &amp; ".")

End Sub

See Also