' Declarations Option Explicit Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long Private Const SND_ASYNC = &H1 Private Const SND_FILENAME = &H20000 Private Const SND_SYNC = &H0 ' Code ' Functions Private Function SndPlay(ByVal filename As String, _ Optional ByVal options As Long = (SND_FILENAME Or _ SND_ASYNC)) As Long SndPlay = sndPlaySound(filename, options) End Function Private Function SndPlayEx(ByVal filename As String, _ Optional ByVal lmodule As Long = 0, Optional ByVal _ options As Long = (SND_FILENAME Or SND_ASYNC)) As Long SndPlayEx = PlaySound(filename, lmodule, options) End Function ' Sample usage ... ' Add two command buttons(Command1,Command2)in the form ' NOTE: change the filename to a valid WAV file.. Private Sub Command1_Click() SndPlay "c:\windows\media\tada.wav" End Sub Private Sub Command2_Click() SndPlayEx "c:\windows\media\tada.wav" End Sub