Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / August 2004

Tip: Looking for answers? Try searching our database.

Play Sound

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Owen - 27 Jul 2004 17:11 GMT
Hi

Does anybody know how to get a form to play a sound when the recipient opens
a specific form.

Thanks for any advice.

Owen
sparkle_guy - 29 Jul 2004 01:11 GMT
Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
   (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

then

If Application.CanPlaySounds Then
Call sndPlaySound32("pathname_of_wavfile_to_be_played", 0)

This works in a macro in excel it might work for you too

> Hi
>
[quoted text clipped - 4 lines]
>
> Owen
Owen - 29 Jul 2004 12:48 GMT
Sparkle

Thanks for the reply. I thought it may be simpler as I am not a great
programmer and the code you have sent doesn't make much sense.

Thanks

Owen

> Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
>     (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
[quoted text clipped - 15 lines]
> >
> > Owen
sparkle_guy - 31 Jul 2004 16:27 GMT
Just cut and  paste the two bits into your macro or vbscript. The all you
have to do is put the correct path to the sound file. NB The sound file
needs to be a .wav file

> Sparkle
>
[quoted text clipped - 24 lines]
> > >
> > > Owen
Owen - 03 Aug 2004 15:36 GMT
Hi Sparkle

Followed your advice and just get compiler errors.

Only comments can appear after end sub, end function or end property.

Thnak for your help

Owen

> Just cut and  paste the two bits into your macro or vbscript. The all you
> have to do is put the correct path to the sound file. NB The sound file
[quoted text clipped - 28 lines]
> > > >
> > > > Owen
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.