Run script rule not exectued for first few mails

Status
Not open for further replies.
L

Luc

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.
 
L

Luc

On Fri, 03 Jul 2009 08:47:59 +0200, Luc <lucvdv@newsgroup.nospam> 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.
 
L

Luc

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 <lucvdv@newsgroup.nospam> wrote:


> On Fri, 03 Jul 2009 08:47:59 +0200, Luc <lucvdv@newsgroup.nospam> 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.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
E Having some trouble with a run-a-script rule (moving mail based on file type) Outlook VBA and Custom Forms 5
B Outlook rule run a Script doesn't work Outlook VBA and Custom Forms 1
Bri the Tech Guy Run Script rule not running for newly arriving messages Outlook VBA and Custom Forms 25
Vijay Error in rule- Run a script Using Outlook 1
Diane Poremsky Run a Script Rule: Send a New Message when a Message Arrives New Slipstick.com Articles 2
L Run a Script Rule doesn't work Using Outlook 5
L Cannot run script from rule Outlook VBA and Custom Forms 7
O modify vba to run it as script rule Outlook VBA and Custom Forms 8
Jeff Rott Diane Question on "Use in a Run a Script Rule" Outlook VBA and Custom Forms 1
Aussie Rules Run a Script on an Incoming Email OK and then the Email reverts Outlook VBA and Custom Forms 0
Y Outlook 2013 Run A Script Outlook VBA and Custom Forms 4
B Wanting to run a script that will filter any body that has a russian link in it. Outlook VBA and Custom Forms 5
Bri the Tech Guy Registry Tweak to make "Run a Script" Action Available Outlook VBA and Custom Forms 2
Vijay Run script doesn't work in outlook Using Outlook 1
oliv- How to Run a Script IN AN ADDIN with Outlook's Rules and Alerts Outlook VBA and Custom Forms 2
X Outlook script to run excel data Outlook VBA and Custom Forms 1
D RUN SCRIPT WHEN OUTLOOK IS CLOSE Outlook VBA and Custom Forms 1
P How many subs can run in one outlook VBA script Using Outlook 5
Xueying run a script in rules, first time succeed, failed afterwards Outlook VBA and Custom Forms 3
P Vba script including macro appears in rules but wont run Outlook VBA and Custom Forms 6
J Outlook 2007 Rules & VBA: How to run a script on a report message (ReportItem) Using Outlook 14
L Outlook 2007 Macro to Run a Script From a Contact Form Using Outlook 41
E run script fails suddenly Using Outlook 3
L Run A Script not listed in rules wizard Outlook VBA and Custom Forms 12
M White square in body of Outlook Messages (O2016 Version 2012 32bit Click To Run) Using Outlook 4
C Auto Run VBA Code on new email Outlook VBA and Custom Forms 1
A Apply Selected Emails to outlook rules and Run Rules Using Outlook 5
B VBScript doesn't run on Recipient Email Outlook VBA and Custom Forms 2
A Run-time error '430' on certain emails when trying to set "Outlook.mailitem" as "ActiveExplorer.Selection.Item" Outlook VBA and Custom Forms 2
S Outlook Custom Form Scripting only working when clicking on "Run this form" Outlook VBA and Custom Forms 2
O Outlook 2016 This rule will only run when you check your email in Outlook.... Using Outlook 4
B run scripts Using Outlook 1
A Run time error 424. object required in outlook 2013 Outlook VBA and Custom Forms 10
Dave A Run macro on existing appointment when it changes Outlook VBA and Custom Forms 1
O Run macro automatically at sending an email Using Outlook 11
P errors appear every time I run SCANPST Using Outlook 3
S VBA Macro - Run-time error '424': object required - Help Please Outlook VBA and Custom Forms 3
P Run Time Error 91 when linking contact to task in VBA Outlook VBA and Custom Forms 1
O Having rules run on old mails noved to inbox Outlook VBA and Custom Forms 8
J Custom form code doesn't run Outlook VBA and Custom Forms 2
J VBA Run When Reply Outlook VBA and Custom Forms 4
O VBA to Run Font Change on Outlook Startup Outlook VBA and Custom Forms 4
D Creating an outlook session from Access vba but run silently. With A specific profile Outlook VBA and Custom Forms 1
Diane Poremsky Using Scanpst in Outlook Click to Run New Slipstick.com Articles 0
B Can't run macro from QAT when emailing from Acrobat Outlook VBA and Custom Forms 0
J Outlook 2010 VBScript editor does not run code at all Outlook VBA and Custom Forms 0
D How to Run a Report Based on Age of Inbox Items Outlook VBA and Custom Forms 0
M Office 365 Click to run BCM (Business Contact Manager) 0
D Must now "View on Facebook" for Mentions/Comments-Outlook 2013 click-to-run Using Outlook 2
R Outlook won't run except in Safe mode problem Using Outlook 5

Similar threads

Top