Use:

sndPlaySound is used to play a .WAV file, it has a much lighter footprint than using the MCI.OCX

Declaring the function:

Declare Function sndPlaySound Lib "WINMM.DLL" Alias _
      "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As _
      Long) As Long

Global Const SND_SYNC = &H0         '  play synchronously
Global Const SND_ASYNC = &H1        '  play asynchronously

Calling the function:

'Declare a variable to store the result of the call, PlaySound returns a long indicating if the .WAV file was played or not
Dim lResult As Long
    
'Call the PlaySound function to play the file in sync mode system does not wait until play sound is complete)
 lResult = PlaySound(sFileName, 0, SND_SYNC)

-or-

'Call the PlaySound function to play the file in async mode (system waits until play sound is complete)
 lResult = PlaySound(sFileName, 0, SND_ASYNC)
Hosted by www.Geocities.ws

1