After extensive googling (ten seconds) I found this...
The following code lets you open and close a cd rom drive
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
Private Sub cmdOpenCD_Click()
Dim lRet As Long
lRet = mciSendString("set CDAudio door open", returnstring, 127, 0)
End Sub
Private Sub cmdCloseCD_Click()
Dim lRet As Long
lRet = mciSendString("set CDAudio door closed", returnstring, 127, 0)
End Sub
Hope it helps