This is a lot more difficult than it looks. You need to first find the related program for say MPG. The following should help...
'General Declarations
Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long
'In the sub.
Dim ProgramExec As String
Dim RetVal As Long
Dim ProgramLen As Integer
Dim Dummy As String
Dim FileNum as integer
' First, create a known, Media file
Open temp.mpg For Output As #FileNum
Print #FileNum "Any Text"
Close #FileNum
' Now your ready to find the associated program.
ProgramExec = String(260, 32)
RetVal = FindExecutable(temp.mpg, Dummy, ProgramExec)
'Format the output
ProgramExec = Left$(ProgramExec, InStr(ProgramExec, Chr$(0)) - 1)
' Is an application is found
If RetVal <= 32 Or IsEmpty(BrowserExec) Then ' Error
MsgBox "Could not find associated Program"
End If
Craig
"Procrastination is the art of keeping up with yesterday."