>>> I want to write a VB6 program that allows me to play a short sound
>>> when I click a form. The file will have been previously created and
[quoted text clipped - 21 lines]
>
> The file exists. Do I have to identify it in another way?
Non-language-specific sample code on MSDN is in C++, not VB. You need to
change the sample to something like this:
Public Const SND_SYNC = &H0
Private Sub Form_Click()
PlaySound ("path\to\wavefile.wav", vbNull, SND_SYNC)
End Sub
AllAPI has a some VB sample code here:
http://allapi.mentalis.org/apilist/PlaySound.shtml
Go to the bottom and click the example link.

Signature
- Strictly speaking, it's better than the alternative...
- ...yet someone is clearly doing their job horribly wrong.
Henry Wilson - 08 Mar 2010 20:24 GMT
>>>> I want to write a VB6 program that allows me to play a short sound
>>>> when I click a form. The file will have been previously created and
[quoted text clipped - 33 lines]
>
>Go to the bottom and click the example link.
Fantastic!
Thanks for that....
It will only play .wav files, I gather.
Auric__ - 08 Mar 2010 21:13 GMT
>>>>> I want to write a VB6 program that allows me to play a short sound
>>>>> when I click a form. The file will have been previously created and
[quoted text clipped - 39 lines]
>
> It will only play .wav files, I gather.
I don't know. I don't use sounds in my programs. Ever. (The docs seem to
suggest that other formats are supported, but don't say what. Give it a try
with whatever format you want to use and see what happens.)
--
I never could bring myself to trust a traitor.
Not even a traitor I created.
Henry Wilson - 08 Mar 2010 22:36 GMT
>>>>>> I want to write a VB6 program that allows me to play a short sound
>>>>>> when I click a form. The file will have been previously created and
[quoted text clipped - 41 lines]
>
>I don't know. I don't use sounds in my programs. Ever.
I haven't until now either.
>(The docs seem to
>suggest that other formats are supported, but don't say what. Give it a try
>with whatever format you want to use and see what happens.)
It doesn't seem to want to play wma. That's OK. I can save all the sounds as
.wav
thanks for the help.