PDA

View Full Version : New Item Alert Window in Outlook 2010 using VBA?



bobross419
07-03-2012, 07:45 AM
I currently have a large number of folders with rules that sort to each based on the client; however, as our client count increases I've hit a wall with the max number of Rules that I can use. I've set up a rule to trigger a script that will parse the sender's email and route to the appropriate folder.

The problem that I'm running into is that some of the emails handled by this need to popup in the New Item Alert Window. Unfortunately, I can't seem to figure out how this is done. I've gone so far as to set something up using a Rule.Execute, but upon further investigation it looks like it won't do what I need since it runs against the entire Inbox (or whatever designated folder).

About 2 hours of reading through MSDN and searching google has given me exactly 0 answers, so I'm hoping that someone here can help.

I've even considered splitting the script into 2 separate rules - One that uses the regular New Item Alert option in the wizard. Testing seems to indicate that this doesn't function the way I had hoped. I turned the option on for the Rule that I've been working on and even though the script completes the New Item Alert doesn't appear.

1) What objects/methods should I be using to get a script to dump something into the new item alert window?

2) If 1) isn't possible, is there something that needs to be added to the script so that it will trigger the 'Display in New item alert' option in the Rule itself?

I appreciate any assistance that can be provided here and please let me know if you need any additional information from me. I didn't include the code because it doesn't seem pertinent, but I can post it if it will help.

Thanks in advance,
Bob

bobross419
07-03-2012, 08:03 AM
Just a quick update. I was able to get it to display an alert using the rules wizard... Problem is that since it is run against all incoming emails this isn't going to work for me, so I guess I'll have to figure out how to trigger it in the script itself.

bobross419
07-03-2012, 09:58 AM
I guess I jumped the gun a bit.

I was able to break it out into 4 rules, 3 of which use the sorting script. It isn't as elegant as I would have liked, but by using the "words in sender", "words in recipient", and "words in body/subject" I was able to get it functional. Unfortunately, i still had to add in an additional rule that just Marked as Read because it can't be scripted (as far as I can tell) and fails if combined with a move to folder. 50 rules down to 4 rules is still pretty good though, so I'm satisfied for now.