I would like an audio notification when a condition in met in a form. I've set the conditional formating to change colors. Anyone have any ideas of how to attach a sound wave file to activate when the condition is met? Thanks much!
You've forgotten to tell jamason07 that the API and Constants need to be pasted into the Declarations Section of a Module:
Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" _
(ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10
Public Const SND_PURGE = &H40
Then to call PlaySound:
Dim strWav As String
strWav = "C:\Windows\Media\chord.wav" ' change this to your .wav file
Call PlaySound(strWav, 0, SND_ASYNC Or SND_NODEFAULT)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.