ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¿ï¾Ü¸ê®Æ§¨ ¶i¦Ó¨ú±o¨ä¦W¦r

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-4-2 10:29 ½s¿è

¦^´_ 2# yangjie
  1. Set fd = Application.FileDialog(msoFileDialogFolderPicker)
  2.     With fd
  3.      .AllowMultiSelect = True '
  4.      'AllowMultiSelect ÄÝ©Ê True ¦pªG¤¹³\¨Ï¥ÎªÌ±qÀÉ®×¹ï¸Ü¤è¶ô¿ï¨ú¦h­ÓÀɮסCŪ/¼g Boolean
  5.     '¦ýAllowMultiSelect Äݩʹï msoFileDialogFolderPicker ¤£°_§@¥Î
½Æ»s¥N½X
¥i¥Îªí³æ
  1. Option Explicit
  2. Private Sub UserForm_Initialize()
  3.     Ex
  4.     With ListBox1  '½Ð¥ý¦bªí³æ¤¤¥[¤J³o±±¨î¶µ
  5.         .Font.Size = 12
  6.         .Top = 10
  7.         .Height = .ListCount * .Font.Size
  8.          DoEvents
  9.         .Left = 10
  10.         .Width = 300
  11.         .MultiSelect = fmMultiSelectMulti  '±µ¨ü¦h­«¿ï¨ú
  12.         Width = .Width + 20
  13.         Height = .Height + 40
  14.     End With
  15. End Sub
  16. Private Sub ListBox1_Change()
  17.     Dim s As String, i As Integer
  18.     With ListBox1
  19.         For i = 0 To .ListCount - 1
  20.             If .Selected(i) = True Then s = s & .List(i) & vbLf
  21.         Next
  22.         If s <> "" Then MsgBox s
  23.     End With
  24. End Sub
  25. Private Sub Ex()
  26.     Dim f As Object, e
  27.     Set f = CreateObject("Scripting.FileSystemObject").getfolder(CurDir).SubFolders
  28.     For Each e In f
  29.         ListBox1.AddItem e
  30.     Next
  31. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤Ñ¤W³Ì¬ü¬O¬P¬P¡A¤H¥Í³Ì¬ü¬O·Å±¡¡C
ªð¦^¦Cªí ¤W¤@¥DÃD