Referring to the code in
http://www.mvps.org/access/api/api0001.htm, first
you need to ensure that the Flag parameter includes the value specified by
ahtOFN_ALLOWMULTISELECT, something like:
lngFlags = ahtOFN_FILEMUSTEXIST Or _
ahtOFN_HIDEREADONLY Or _
ahtOFN_NOCHANGEDIR Or _
ahtOFN_ALLOWMULTISELECT
Once you've done that, the value passed back will consist of the folder
name, followed by a null character (Chr$(0)), followed by the name of the
first file selected, followed by a null character, followed by the name of
the second file selected, followed by a null character, and so on until the
last file. There will be two null characters at the end of the string.
Because of the null characters, you can't use the TrimNull function that's
included in the given sample. Instead, take off the last two characters:
ahtCommonFileOpenSave = Left$(OFN.strFile, Len(OFN.strFile)-2)
Then use the Split function to break the string into its component parts:
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY) str
varFiles = Split(strInputFileName, Chr$(0))
strFolder = varFiles(0)
For intLoop = 1 to UBound(varFiles)
Debug.Print strFolder & "\" & varFiles(intLoop)
Next intLoop