Or use the mciSendString API.
VB Code:
  1. 'Open the midi
  2. mciSendString "open C:\MyFile.mid type sequencer alias midi", 0, 0, 0
  3.  
  4. 'Play the midi
  5. mciSendString "play midi", 0, 0, 0
  6.  
  7. 'Stop the midi
  8. mciSendString "stop midi", 0,0,0
  9.  
  10. 'Close the midi
  11. mciSendString "close midi", 0, 0, 0