A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Run script rule not exectued for first few mails



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 3rd 09, 08:47 AM posted to microsoft.public.outlook.program_vba
Luc[_2_]
external usenet poster
 
Posts: 4
Default Run script rule not exectued for first few mails

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  
Old July 3rd 09, 10:26 AM posted to microsoft.public.outlook.program_vba
Luc[_2_]
external usenet poster
 
Posts: 4
Default Run script rule not exectued for first few mails

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  
Old July 7th 09, 07:54 AM posted to microsoft.public.outlook.program_vba
Luc[_2_]
external usenet poster
 
Posts: 4
Default Run script rule not exectued for first few mails

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 05:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.