Private Declare Function mciSendString Lib "winmm.dll" _
Alias "mciSendStringA" _
(ByVal lpstrCommand As String, _
ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, _
ByVal hwndCallback As Long) As Long
Теперь для открытия CD-ROM вызовите эту функцию с такими параметрами:
Call mciSendString("Set CDAudio Door Open Wait", 0&, 0&, 0&)
а ее для закрытия:
Call mciSendString("Set CDAudio Door Closed Wait", 0&, 0&, 0&)