I'm going from memory here, Pete, so don't take this as gospel without
testing it, but my memory is that lpstrFileTitle is only relevant when *not*
selecting multiple files. When selecting multiple files, lpstrFile returns
the path, followed by a null character, followed by a null-character
separated list of selected file names. For example, here's the result of a
test in which I've replaced the null characters with "*" for readability ...
? getopenfilename2(0,"","","",0)
C:\Documents and Settings\Brendan Reynolds\My
Documents\BJECAP02*BJECAP02.ICO*BJECAP02.ldb*Thumbs.db*BJECAP02.MDB*BJECAP02.LOG*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
**
Here's some of the code that produced this result ...
Public Function GetOpenFileName2(Owner As Long, File As String, Filter As
String, _
Title As String, FilterIndex As Long) As String
Const strcProcedure = "GetOpenFileName"
Dim ofn As OPENFILENAME
Dim lngExtendedError As Long
With ofn
.Flags = OFN_ALLOWMULTISELECT Or OFN_EXPLORER
.hwndOwner = Owner
.lpstrCustomFilter = String$(40, vbNullChar)
.lpstrDefExt = "MDB"
.lpstrFile = File & String$(2048 - Len(File), vbNullChar)
.lpstrFileTitle = String$(2048, vbNullChar)
.lpstrFilter = Filter
.lpstrInitialDir = CurrentProject.Path
.lpstrTitle = Title
.lStructSize = Len(ofn)
.nFilterIndex = FilterIndex
.nMaxCustFilter = Len(.lpstrCustomFilter)
.nMaxFile = Len(.lpstrFile)
.nMaxFileTitle = Len(.lpstrFileTitle)
End With
If apiGetOpenFileName(ofn) = 0 Then
lngExtendedError = apiCommDlgExtendedError()
Select Case lngExtendedError
'error handling omitted for brevity ...
End Select
Else
GetOpenFileName2 = Replace(ofn.lpstrFile, vbNullChar, "*")
End If
End Function