![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I recently replaced a number of rules for routing incoming mails to
different folders by a single 'run script' rule, and wrote a more refined version of the filters in VBA (in O2007). Now, every morning when I start up outlook, the script is skipped for the first handful of mails that are already waiting at the mail server (mails are downloaded to personal folders, the script routes them to different folders there). When I start the script manually (tools / rules / run rules now), it moves the mails to the right folders, and from then on everything works as expected -- until the next day when I launch Outlook. So what I think this means is that there's some kind of delay after Outlook is started, before VBA begins to work. The rule is still executed for later mails, also if I don't start it manually, but the first handful always remain in my inbox. Does anyone know more about this, and maybe a solution or a workaround? Some way to delay collecting mail for 10-15 seconds after Outlook is started should do the trick, I think. |
Ads |
#2
|
|||
|
|||
![]()
On Fri, 03 Jul 2009 08:47:59 +0200, Luc wrote:
Some way to delay collecting mail for 10-15 seconds after Outlook is started should do the trick, I think. I think I just /may/ have thought of a solution, but as there are no mails waiting on the server when I start Outlook now, I'll have to wait until monday to see if it works. The solution would be to create an Application_Startup script with just some dummy code that doesn't really do anything, except being there. For testing I put a MsgBox in it. It looks like it is executed at startup before Outlook connects to the server. I sent a test mail to myself and then immediately closed Outlook, before it could arrive. Then restarted Outlook, the mail arrived only after I closed the messagebox, and the filter script correctly ran on it. If this still works on Monday, I'm going to try replacing the message box by something that doesn't require interaction. |
#3
|
|||
|
|||
![]()
After trying it out for two days: this works indeed. Just put some code in
the Application Startup event - anything at all, I think - and the incoming mail rule/script will run for every mail from the first one on. No code in the Startup event, and the script is skipped for the first few mails that arrive immediately after Outlook is launched. On Fri, 03 Jul 2009 10:26:56 +0200, Luc wrote: On Fri, 03 Jul 2009 08:47:59 +0200, Luc wrote: Some way to delay collecting mail for 10-15 seconds after Outlook is started should do the trick, I think. I think I just /may/ have thought of a solution, but as there are no mails waiting on the server when I start Outlook now, I'll have to wait until monday to see if it works. The solution would be to create an Application_Startup script with just some dummy code that doesn't really do anything, except being there. For testing I put a MsgBox in it. It looks like it is executed at startup before Outlook connects to the server. I sent a test mail to myself and then immediately closed Outlook, before it could arrive. Then restarted Outlook, the mail arrived only after I closed the messagebox, and the filter script correctly ran on it. If this still works on Monday, I'm going to try replacing the message box by something that doesn't require interaction. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rule to run script | Mike C | Outlook - General Queries | 4 | August 15th 08 10:55 PM |
Rule 'run a script' not running my script | [email protected] | Outlook and VBA | 3 | May 30th 06 01:09 PM |
"Run a script" rule triggers but script does not execute | Trey Shaffer | Outlook and VBA | 7 | April 8th 06 12:34 AM |
Create rule by script | Louis | Outlook and VBA | 3 | March 15th 06 05:49 PM |
Script in Rule | clarkel | Outlook and VBA | 2 | February 2nd 06 09:20 PM |