Play a song when you open emails

G

Guest

Is there any way to play a song every time you open up an email or when you
open outlook in general? I noticed that you can do some programming in
Outlook, but I did not know if this was possible. Could someone please
respond with an answer? Thank you very much!!!
 
J

John Blessing

Goirish1904 said:
Is there any way to play a song every time you open up an email or when
you
open outlook in general? I noticed that you can do some programming in
Outlook, but I did not know if this was possible. Could someone please
respond with an answer? Thank you very much!!!


Not sure you can do it on opening an email, but you could put code in the
application.startup event to:

Shell "c:\windows\System32\sndrec32.exe /play /close
C:\pathtoyoursong\song.wav", vbHide


I'm sure it would get pretty irritating, very quickly


John Blessing



http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
send newsletters
 
G

Guest

John,

Is that code the exact code to put in the application.startup event and
where can I get to the application.startup event?

Thanks for your help.
 
J

John Blessing

Tools, macros, visual basic editor

Under the tree view in the left, expand "microsoft visual basic", then
beneath that "thisoutlooksession". Then in the main window, select
Application from the left dropdown, then "startup" from the right dropdown,
then insert the code between :

Private Sub Application_Startup()

End Sub


the code mentioned should work OK, obviously change the path/name

John Blessing
(e-mail address removed)
http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook


Tel: +44 (0) 870 741 9887 or +1 (216) 359 4425
Fax: +44 (0) 870 751 9889
Alternate Tel +44 (0) 207 993 8116
 
G

Guest

John,

I did everything you told me to do...I put this exact code in:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

End Sub

Private Sub Application_Startup()
Shell "c:\windows\System32\sndrec32.exe /play /close"
"C:\Desktop\Notre Dame Marching Band - Notre Dame Victory March.wav", vbHide
End Sub

It is giving me an error saying:

Compile error:
Expected: line number or label or statement or end of statement

Can you please tell me how to fix this?

Thank you John.
 
J

John Blessing

Too many "


Shell "c:\windows\System32\sndrec32.exe /play /close C:\Desktop\Notre Dame
Marching Band - Notre Dame Victory March.wav", vbHide


- all on one line.

--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.room-booking-software.com - Schedule rooms & equipment bookings
for your meeting/class over the web.
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook, find/replace,
send newsletters
 
G

Guest

John,
Putting all of the code on one line did end up fixing the error, however it
is not playing the song when I open up outlook. This is my exact code again:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

End Sub

Private Sub Application_Startup()
Shell "c:\windows\System32\sndrec32.exe /play /close C:\Desktop\Notre Dame
Marching Band - Notre Dame Victory March.wav", vbHide

End Sub

Do I need to put anything in this part?
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

End Sub

Please let me know what you think. Again I appreciate all of your help.
 
J

John Blessing

Just highlight and delete the:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

End Sub

Or don't, doesn't make any difference.

When you say it doesn't work, any errors? Works on mine.

Check that the files c:\windows\System32\sndrec32.exe and C:\Desktop\Notre
Dame Marching Band - Notre Dame Victory March.wav both exist

Of course, if you are using Vista, MS for some stupid reason decided to
rename sound recorder to some other filename, sorry I can't remember what
the new name is, .
 
G

Guest

John,

Allright man...we will give this one more shot and then I will stop buggin
ya...
It is still not working... I verified that both paths are valid and that
both files are there so that is not an issue. I still have the same code in
there with the first part deleted like you told me to. My question to you is
yours works right...can you send me the exact code what you have in that
window, minus the path one more time. I'm sure it is going to be the same
one you have been giving me, but I'm just going to copy and paste this one
that you send me. So, if the code works, when you open outlook a song will
play, correct? Let's try this again one more time...Thanks again for your
help.
 
J

John Blessing

Private Sub Application_Startup()
Shell "c:\windows\System32\sndrec32.exe /play /close C:\Documents and
Settings\John Blessing\My Documents\Lbe\Sounds\trumpet1.wav", vbHide

End Sub
 
G

Guest

John,

Hey man...I figured out what was wrong...My security level was set at high,
so therefore the VB was disabled. It definately works just fine. Last
question for you though...how do you make it to where the song will stop
playing when you close Outlook? The song just kept playing...

Thanks man.
 

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

Top