Tác giả: truongphu
Mô tả: CommonDialog.Show Open Chọn nhiều File
Unicode Full Controls ™ Version 1.7.3 [21/11/2008] của bạn DQHung có nói đến nhưng lỗi
Tôi viết lại để hoạt động êm hơn
Code: Select all
Private Const CD_FLAGS = cdlOFNAllowMultiselect + cdlOFNExplorer + cdlOFNLongNames Private Sub Command1_Click() Dim i%, Path$, Files() As String With CommonDialog1 .MaxFileSize = 32000 'max buffer .Flags = CD_FLAGS .ShowOpen Files = Split(.FileName, vbNullChar) Select Case UBound(Files) Case 0 ' 1 file List1.AddItem Files(0) Case Is > 0 For i = 1 To UBound(Files) Path = Files(0) & IIf(Right(Files(0), 1) <> "\", "\", "") & Files(i) List1.AddItem Path Next i End Select End WithEnd Sub