Postup:
Do projektu přidejte referenci na Microsoft Scripting Runtime. Na
formulář přidejte tlačítko a na jeho událost Click zapište:
Private Sub Command1_Click()
Dim fso As FileSystemObject, d As Object, e As Drives, i As Byte
Set fso = CreateObject("Scripting.FileSystemObject")
Set e = fso.Drives
For Each d In e
If d.DriveType = 4 Then
If d.isready = True Then
MsgBox
"V CD-Rom mechanice " & d.DriveLetter & ": je vložen
disk."
Else
MsgBox
"V CD-Rom mechanice " & d.DriveLetter & ": není vložen
disk."
End If
End If
Next
End Sub
|