Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Dim Fichier, Son, WavFile As String
Private Sub Noms_Change()
Fichier = ThisWorkbook.Path & "\"
Son = Me.Nom.Text
WavFile = Fichier & Son & ".wav"
Call PlaySound(WavFile, 0&, SND_ASYNC Or SND_FILENAME)
End Sub
Private Sub CmdPlay_Click()
Fichier = ThisWorkbook.Path & "\"
Son = Me.Nom.Text
WavFile = Fichier & Son & ".wav"
Call PlaySound(WavFile, 0&, SND_ASYNC Or SND_FILENAME)
End Sub
Private Sub CmdOff_Click()
'ici fallait mettre &H1
Call PlaySound(&H1, 0&, SND_ASYNC Or SND_FILENAME)
End Sub