Adding Sound to a VBA Program : Wav Sound « Windows API « VBA / Excel / Access / Word






Adding Sound to a VBA Program

 
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Sub playSound()
    sndPlaySound "C:\myWave.wav file", 1
    returnVal = sndPlaySound("C:\myWave.wav", 0)
End Sub

 








Related examples in the same category

1.Call windows API to play a sound