playing a sound...

K

Karl E. Peterson

mnb4vba2007in2010 said:
How are you supposed to program to play a sound in VBA (Outlook2007)?

What sort of sound? A simple WAV file can be done like this:

Private Declare Function PlaySound Lib "winmm.dll" Alias
"PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal
dwFlags As Long) As Long

Public Sub PlayWave(ByVal FileName As String)
Const SND_ASYNC As Long = &H1
Const SND_FILENAME As Long = &H20000
Call PlaySound(FileName, 0&, SND_ASYNC Or SND_FILENAME)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top