Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Function PlaySound(FileName As String)
Dim MyReturn As Long
MyReturn = sndPlaySound(FileName, 1)
If (MyReturn <> 1) Then GoTo ErrHandler
'********************
'* Exit Procedure *
'********************
ExitProcedure:
Exit Function
'****************************
'* Error Recovery Section *
'****************************
ErrHandler:
Msgbox "Error from sndPlaySound" & vbCrLf & "Value is " & MyReturn, vbExclamation
GoTo ExitProcedure
End Function