Comment choisir parmi les lecteurs disponibles ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Private Sub Choisir_Un_Lecteur_Disponible()
 
Lecteurs = ShowDriveList
 
t = Split(Lecteurs, vbLf)
 
LecteurChoisi = InputBox(result, "Entrez le lecteur choisi", t(UBound(t) - 1))
 
chemin = LecteurChoisi & ":\"
 
End Sub
 
Function ShowDriveList()
   Dim fso, d, dc, s, n
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set dc = fso.Drives
 
   ShowDriveList = ""
   For Each d In dc
      s = d.DriveLetter
      If d.DriveType = 3 Then
      ElseIf d.IsReady Then
         n = d.VolumeName
         ShowDriveList = ShowDriveList & d.DriveLetter & vbLf
      End If
   Next
 
End Function