applcation.run

S

SURESH TP

good morning to everybody


Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Private Sub test()
sndPlaySound "C:\Suresh\Twinkle1.wav", SND_ASYNC
End Sub

the above metioned macro is working well.. the prob. is that i want to keep this as my backgroud music, meanwhile i want to work as usual.. and also it should run until i will close the file.

anybody can help me??

thanks in advance

with best regards,
suresh tp
 
B

Bob Phillips

Try this

Private nTime As Date

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Private Sub test()
playSound
End Sub

Sub playSound()
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
nTime = Now() + TimeSerial(0, 0, 10) ' 10 secs
sndPlaySound "C:\Windows\Media\Microsoft Office 2000\Chimes.wav", SND_ASYNC
Application.OnTime nTime, "playSound"
End Sub

Sub stopSound()
Application.OnTime nTime, "playsound", schedule:=False
End Sub



--

HTH

RP
(remove nothere from the email address if mailing direct)


good morning to everybody


Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Private Sub test()
sndPlaySound "C:\Suresh\Twinkle1.wav", SND_ASYNC
End Sub

the above metioned macro is working well.. the prob. is that i want to keep this as my backgroud music, meanwhile i want to work as usual.. and also it should run until i will close the file.

anybody can help me??

thanks in advance

with best regards,
suresh tp
 
S

SURESH TP

hi dear bob..
good evening.. thank you for you advise

and now what is the prob. that when i am exit the file is opening the automatically. to close the file i have to close twise.

plz. help me..

best regards,
suresh

Try this

Private nTime As Date

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Private Sub test()
playSound
End Sub

Sub playSound()
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
nTime = Now() + TimeSerial(0, 0, 10) ' 10 secs
sndPlaySound "C:\Windows\Media\Microsoft Office 2000\Chimes.wav", SND_ASYNC
Application.OnTime nTime, "playSound"
End Sub

Sub stopSound()
Application.OnTime nTime, "playsound", schedule:=False
End Sub



--

HTH

RP
(remove nothere from the email address if mailing direct)


good morning to everybody


Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Private Sub test()
sndPlaySound "C:\Suresh\Twinkle1.wav", SND_ASYNC
End Sub

the above metioned macro is working well.. the prob. is that i want to keep this as my backgroud music, meanwhile i want to work as usual.. and also it should run until i will close the file.

anybody can help me??

thanks in advance

with best regards,
suresh tp
 
S

SURESH TP

hi dear bob..
good evening.. thank you for you advise

and now what is the prob. that when i am exit the file is opening the automatically. to close the file i have to close twise.

plz. help me..

best regards,
suresh

Try this

Private nTime As Date

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long

Private Sub test()
playSound
End Sub

Sub playSound()
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
nTime = Now() + TimeSerial(0, 0, 10) ' 10 secs
sndPlaySound "C:\Windows\Media\Microsoft Office 2000\Chimes.wav", SND_ASYNC
Application.OnTime nTime, "playSound"
End Sub

Sub stopSound()
Application.OnTime nTime, "playsound", schedule:=False
End Sub



--

HTH

RP
(remove nothere from the email address if mailing direct)


good morning to everybody


Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Private Sub test()
sndPlaySound "C:\Suresh\Twinkle1.wav", SND_ASYNC
End Sub

the above metioned macro is working well.. the prob. is that i want to keep this as my backgroud music, meanwhile i want to work as usual.. and also it should run until i will close the file.

anybody can help me??

thanks in advance

with best regards,
suresh tp
 
T

Tushar Mehta

Consider using a program better suited to the task of playing background
music. Use Windows Media Player or Real Player or...

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
+ Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2005
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top