Ok.
This bit goes in General_Declarations (click general in the left combo of the code window, and declaractons in the right)
Code:Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
This line of code tells vb that you want to use a windows internal function (API) to play the sound.
Next, put this bit in the event procedure where you want to play the sound eg. a command_click() event or something.
Code:Dim SoundFile As String, Result As Long
SoundFile = "C:\Windows\Media\Ding.wav"
Result = sndPlaySound(SoundFile, 1)
Change the bit "C:\Windows\Media\Ding.wav" to the path of the sound file you want play. eg.
Code:App.Path & "\sound.wav"
or something.
If you need anymore help let me know.
Hope this works.
Enter your message below
Sign in or Join us (it's free).