Notaðu API kall sem þú skilgreinir svona
Private Declare Function sndPlaySound Lib \“winmm.dll\” _
Alias \“sndPlaySoundA\” (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
Síðan geturðu kalla í það
1. Dæmi
Dim SoundFile As String, ReturnLength As Long
SoundFile = Dir(\“c:\\Windows\\System\\\” & \“*.wav\”)
Result = sndPlaySound(SoundFile, 1)
2. Dæmi
Dim WaveFiles(10) As String
Dim i As Integer, worked As Integer
For i = 0 to UBound(WaveFiles)
worked = sndPlaySound(WaveFiles(i), 0)
Next i
<BR