VBA/Excel/Access/Word/Windows API/Wav Sound — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:48, 26 мая 2010
Adding Sound to a VBA Program
<source lang="vb">
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Sub playSound()
sndPlaySound "C:\myWave.wav file", 1 returnVal = sndPlaySound("C:\myWave.wav", 0)
End Sub
</source>
Call windows API to play a sound
<source lang="vb">
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Public Sub PlaySound(SoundFile As String)
sndPlaySound SoundFile, 1
End Sub
</source>