[blue]Function FileName()
Dim ProjectFile As OPENFILENAME
With ProjectFile
.lStructSize = Len(ProjectFile)
.hwndOwner = 0
.hInstance = 0
.lpstrFile = Space$(254)
.nMaxFile = 255
.lpstrFileTitle = Space$(254)
.nMaxFileTitle = 255
.lpstrInitialDir = Chr$(0)
.flags = 0
[green]' Following is the Dialog Title[/green]
.lpstrTitle = "Select Project File"
[green]' Following is a filter for the type of file -
' (a) a literal which is displayed in the [i]Files of Type[/i] box, and
' (b) a filter restricting the files shown
' Change these according to your needs.[/green]
.lpstrFilter = "Microsoft Project Files (*.mp*)" + Chr$(0) + "*.mp*" + Chr$(0)
End With
If GetOpenFileName(ProjectFile) Then
FileName = Trim$(ProjectFile.lpstrFile)
Else
Exit Function
End If
End Function[/blue]