Public Function Open_File(FileNames() As String)
On Error GoTo ErrorHandler
With CommonDialog
.Filter = "Bitmap Image File (*.BMP)|*.BMP|All Files (*.*)|*.*"
.DefaultExt = ".BMP"
.DialogTitle = "Open"
.MaxFileSize = 32767
.Flags = cdlOFNAllowMultiselect + cdlOFNLongNames + cdlOFNExplorer
.ShowOpen
If .FileName = "" Then GoTo ErrorHandler
FileNames() = Split(.FileName, vbNullChar)
End With
If UBound(FileNames) = 0 Then
temp = FileNames(0)
ReDim FileNames(1)
FileNames(1) = temp
End If
Open_File = True
Exit Function
ErrorHandler:
Open_File = False
End Function
因此,使用此代码,如果我调用它来指定一些文件,则可以完美地工作;但是,当我放置多个文件时,它超过了MaxFileSize的限制。是否可以通过CommonDialog机制获取很多文件,或者您会完全推荐其他东西吗?