View Full Version : Solved: Can someone with outlook 2003 and sound help me test something?
mvidas
06-19-2007, 06:07 AM
Can someone please help me test something? Attached zip contains 4 files:
"notify.wav" - extract to C:\ (or change location in vSoundMdl.bas)
"ThisOutlookSessionCode.txt" - copy/paste code into ThisOutlookSession object in outlook vba
"vSoundMdl.bas" and "vSoundCls.cls" - import into outlook VBA project
To test:
-Open new mail message, address it to yourself. subject/body are unimportant, don't send just yet
-Change focus to something other than outlook, then re-focus on new message. click send
-After a couple seconds, the .wav file should repeat until outlook application gets focus
The sound will only play when a new message is received and outlook doesnt have focus. once outlook gets focus the sound is stopped (until the same conditions are met again)
Much thanks!!
Matt
Charlize
06-19-2007, 06:37 AM
Nice one. Have tested this with focus and without focus. One problem (just little one) is that when you've got focus and message arrives, there is indeed no sound. When I minimize outlook to taskpane (icon) I receive still a notificiation of outlook of new message (even if I marked it as read) and thus the noise will start as if there was a new mail when no focus on outlook.
When no focus there comes that irritant noise (looks like a submarine sound) and on opening outlook, the noise stops. When minimizing outlook, even with unread new items, the noise doesn't start over again.
mvidas
06-19-2007, 06:45 AM
Nice one. Have tested this with focus and without focus. One problem (just little one) is that when you've got focus and message arrives, there is indeed no sound. When I minimize outlook to taskpane (icon) I receive still a notificiation of outlook of new message (even if I marked it as read) and thus the noise will start as if there was a new mail when no focus on outlook.This was a slight change to my scroll-lock blinker code for someone who didn't like that outlook just made one sound and goes silent on new mail. But if I'm reading this right..
-Outlook has focus, no annoying sound is played (intended).
-You read the message, minimize outlook, and then the noise starts with no new message received? Hmmmm... not good
When no focus there comes that irritant noise (looks like a submarine sound) and on opening outlook, the noise stops. When minimizing outlook, even with unread new items, the noise doesn't start over again.I thought about triggering this on Items_Add so it would play until a message is read (regardless of outlook having focus), but I was going to wait until the requester asked for it (since I'd do it for all outlook folders, and have to catch folder_add/etc too).
I'm thinking this would be a lot easier with 2003 since the rules can send the new mail to a custom event code, but with 2000 I don't have access to that. As you're good with outlook and have 2003, do you think thats worth exploring? I have 2003 at home but I hate the security warnings, so I never installed it.
Charlize
06-19-2007, 07:07 AM
I wouldn't insist on reading all the new mail. If they find a way they will just mark them read to get rid of that noise or by muting the speakers (can we unmute the speakers by code ?).
I would check the inbox and if something arrives, play sound. Why would you go through all the folders ? You already know there is something knew. Unless if you just want that noise if something unread is left in the inbox after all the filters. As the last rule I would check the inbox by using the ruleswizard (If I understand what you want to do).
mvidas
06-19-2007, 07:18 AM
I wouldn't insist on reading all the new mail. If they find a way they will just mark them read to get rid of that noise or by muting the speakers (can we unmute the speakers by code ?). There is (waveOutGetVolume and waveOutSetVolume from winmm.dll), except for those people who have amplified speakers and manually turn the sound down. I'm not trying to force the volume issue though, if someone wants it off, its probably for a good reason. :)
I would check the inbox and if something arrives, play sound. Why would you go through all the folders ? You already know there is something knew. Unless if you just want that noise if something unread is left in the inbox after all the filters. As the last rule I would check the inbox by using the ruleswizard (If I understand what you want to do).
I was saying check all the folders if I was using the _Add event of an Items object, in case the guy uses rules to separate his email and wants it to happen to everything (trying to be too thorough I think) and only stop on message read.
I think I'm just living up to my title again :) This was the original question:
I have an XP workstation with Outlook Express and Outlook 2003. They both could be setup for the pop. I'm planning on introducing an exchange server so that would take away outlook express. I need the Outlook to alert me when email comes in untill i answer the email. The notification Outlook has isn't right for the situation. I need it to constantly play a wave until I check the email. Like a pager continues till you hit a button.
Thanks, Charlize. I'm gonna mark this as solved, since it does work (the 'sound plays once outlook is minimized' is a timer issue, which I'm working on now). I really appreciate the help!
mvidas
06-19-2007, 07:25 AM
FWIW, fixed the extra sound issue (at least on my PC) by:
Adding to vSoundMdl:Public pnIDEvent As Long
Setting the public variable in PlaySound:Sub PlaySound(ByVal hwnd As Long, ByVal uMsg As Long, ByVal nIDEvent As Long, _
ByVal dwTimer As Long)
pnIDEvent = nIDEvent
DoEvents
'rest is the same
Then adding KillTimer call to StopSound in vSoundCls:Sub StopSound()
KillTimer 0&, pnIDEvent
KeepPlaying = False
'rest the same
Charlize
06-19-2007, 02:10 PM
Will test it when I'm back at the office (physically). Must say that the office uses an exchange server with local installations of outlook 2003. Mail stays on the server so remote users can still view all the mails.
Thanks in advance.
sphere
08-20-2007, 06:06 AM
Hrm, very interesting. Maybe this way I can circumvent the rediculous behaviour of Outlook where it refuses to show Desktop alerts and play sounds for messages that are not filtered.
I know, it is possible to have the alert show and the sound played in the rule, but then the rule only applies to the local machine :(
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.