S
Soniya
Hi All,
The following code I recieved from this newsgroup:
Private Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
Sub PlayWavFile(WavFileName As String, Wait As Boolean)
If Dir(WavFileName) = "" Then Exit Sub ' no file to play
If Wait Then ' play sound before running any more code
sndPlaySound WavFileName, 0
Else ' play sound while code is running
sndPlaySound WavFileName, 1
End If
End Sub
Now I am trying to play a sound file and change TextBox Text from the
following, but text box dont change.
under the CmbRef change I have code to change the text in TextBox1.
I know the CmbRef changes and the coresponding sound file is played but
for some reason it is not displaying the text in the textbox.
What I am trying to do is that play display a text in textbox and play
a sound file according to user selection in combobox CmbRecF
(starting) and combobox CmbRecT(ending). based on this selection in my
sheet1 column A text is displayed in textbox and sound played.
I have all those thing working properly excepet the display of
corresponding text while playing the sound.
Sub TestSoundFile()
Dim WAVFile As String
Dim v As Variant
Dim Y, Z As Variant
v = Split(CmbRef, ":")
Y = Format(v(0), "000")
Z = Format(v(1), "000")
WAVFile = Y & z & ".wav"
WAVFile = "D:\Folder\Mele\" & WAVFile
PlayWavFile WAVFile, True
End Sub
Private Sub CmdSound_Click()
Application.ScreenUpdating = True
If CmbRecT.ListIndex < CmbRecF.ListIndex Then
CmbRecT = CmbRecF
End If
Do While CmbRef <= CmbRecT
TestSoundFile
If CmbRef = CmbRecT Then Exit Sub
CmbRef.ListIndex = CmbRef.ListIndex + 1
Application.Wait (Now + TimeValue("0:00:01"))
Loop
End Sub
Thanks
The following code I recieved from this newsgroup:
Private Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
Sub PlayWavFile(WavFileName As String, Wait As Boolean)
If Dir(WavFileName) = "" Then Exit Sub ' no file to play
If Wait Then ' play sound before running any more code
sndPlaySound WavFileName, 0
Else ' play sound while code is running
sndPlaySound WavFileName, 1
End If
End Sub
Now I am trying to play a sound file and change TextBox Text from the
following, but text box dont change.
under the CmbRef change I have code to change the text in TextBox1.
I know the CmbRef changes and the coresponding sound file is played but
for some reason it is not displaying the text in the textbox.
What I am trying to do is that play display a text in textbox and play
a sound file according to user selection in combobox CmbRecF
(starting) and combobox CmbRecT(ending). based on this selection in my
sheet1 column A text is displayed in textbox and sound played.
I have all those thing working properly excepet the display of
corresponding text while playing the sound.
Sub TestSoundFile()
Dim WAVFile As String
Dim v As Variant
Dim Y, Z As Variant
v = Split(CmbRef, ":")
Y = Format(v(0), "000")
Z = Format(v(1), "000")
WAVFile = Y & z & ".wav"
WAVFile = "D:\Folder\Mele\" & WAVFile
PlayWavFile WAVFile, True
End Sub
Private Sub CmdSound_Click()
Application.ScreenUpdating = True
If CmbRecT.ListIndex < CmbRecF.ListIndex Then
CmbRecT = CmbRecF
End If
Do While CmbRef <= CmbRecT
TestSoundFile
If CmbRef = CmbRecT Then Exit Sub
CmbRef.ListIndex = CmbRef.ListIndex + 1
Application.Wait (Now + TimeValue("0:00:01"))
Loop
End Sub
Thanks