It's probably trying to open up with a media player that you don't have on your machine.  Here's some code I used in VB to play a wav file.
 
Global Const SND_SYNC = &H0                    ' Play synchronously
Global Const SND_NODEFAULT = &H2               ' Silence not default, if sound not found
Global Const SND_ASYNC = &H1                   ' Play async
 
Public Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszSoundName As String, ByVal hModule As Long, ByVal uFlags As Long) As Long
Dim X as long
 
        X = PlaySound(App.Path & "\zarathustra.WAV", 0, SND_ASYNC Or SND_NODEFAULT)
 
I hope this helps.

Martin E. Reiter
Applications Programming Manager
Commonwealth Health Corporation

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of White, Scott A
Sent: Friday, January 21, 2005 8:54 AM
To: [email protected]
Subject: [Talk] Launching sound file

Hello everyone,
 
I have a procedure that I want to call if a certain condition exists.
Basically, I want an audible sound to draw my attention to my p.c..

 Sub SoundAlert()
    Shell "C:\WINNT\Media\Microsoft Office 2000\CHIMES.WAV"
 End Sub
 
I get - "Invalid procedure call or argument".
 
Can anyone tell me why it doesn't work?
 
Thank you,
Scott

 


CONFIDENTIALITY NOTICE: This e-mail communication and any attachments
may contain confidential and privileged information for the use of the
designated recipients named above.  If you are not the intended
recipient, you are hereby notified that you have received this communication in
error and that any review, disclosure, dissemination, distribution or copying
of it or its contents is prohibited. If you have received this
communication in error, please notify Saratoga Hospital immediately by e-mail at
[EMAIL PROTECTED] and destroy all copies of this communication
and any attachments.


"Important Warning: This message is intended for the use of the person or entity to whom it is addressed and may contain information that is privileged and confidential. This disclosure is governed by applicable law.

If you are not the intended recipient, employer, or agent responsible for delivery to the intended recipient, you are hereby notified that any disclosure, copying, or distribution of this information is strictly prohibited."

Reply via email to