Rule problem

Status
Not open for further replies.

lgnfox

Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Good afternoon!

There is a rule in outlook, it applies when the Email comes from definite address and runs VBA script. There are cases, when this rule doesn’t work correctly. The problem appears then I send some Email simultaneously.

Example:

I send three Email with subjects FW: 1, FW: 2, FW: 3

In Inbox I see them in order FW: 1, FW: 2, FW: 3

But my script gives:

20.01.2012 15:13:29:0974 ***** Process ***** 20.01.2012 15:13:21 Subject FW: 3

20.01.2012 15:13:29:0988 ***** Process ***** 20.01.2012 15:13:18 Subject FW: 2

20.01.2012 15:13:30:0004 ***** Process ***** 20.01.2012 15:13:15 Subject FW: 1

It reverses order Email to FW: 3, FW: 2 FW: 1

Sqript:



Option Explicit


Private Type SYSTEMTIME

wYear As Integer

wMonth As Integer

wDayOfWeek As Integer

wDay As Integer

wHour As Integer

wMinute As Integer

wSecond As Integer

wMilliseconds As Integer

End Type

Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)

Sub CustomMailMessage_111111111111(Item As Outlook.MailItem)

Dim Path As String

Path = "C:\Post_CB"

Dim fso As Variant

Set fso = CreateObject("Scripting.FileSystemObject")

Dim idFile_Llog As Variant

Set idFile_Llog = fso_OpenTextFile(Path & "\log_in.log", 8, True)

Dim tSystem As SYSTEMTIME

GetSystemTime tSystem

idFile_Llog.writeline (CStr(Now()) & ":" & Format(tSystem.wMilliseconds, "0000") & " ***** Process ***** " & CStr(Item.ReceivedTime) & " Subject " & CStr(Item.Subject))

idFile_Llog.Close

Set fso = Nothing

End Sub



How can I get another order:

20.01.2012 15:13:29:0974 ***** Process ***** 20.01.2012 15:13:21 Subject FW: 1

20.01.2012 15:13:29:0988 ***** Process ***** 20.01.2012 15:13:18 Subject FW: 2

20.01.2012 15:13:30:0004 ***** Process ***** 20.01.2012 15:13:15 Subject FW: 3
 
Outlook is sending them in last in - first out order. You can't force it to change, other than by slowing down the sends. I don't think a rule to hold mail for 1 min would change it, because they are so close in time - but that would also slow down the sends even more. I'm not sure who much time you'd need between messages, in part because it depends on how busy it is with other tasks. If its not real busy, it will start sending these messages as soon as it gets them.

You can watch it by setting outlook offline before sending then go online after opening the outbox. Outlook sends the newest message first (regardless of the sort order in the folder).
 
Thanks for response.

Unfortunately I can’t influence sending process, because the email comes from other organization. In above post I subscribe example which gives the root of the problem.

I can change receiving settings only.
 
Are you using cached mode? The order might be correct if you use classic online mode - the code is getting the recieved time, not the sent time. But when outlook syncs, it doesn't always sync oldest to newest - outlook syncs with the server every few seconds and gets new mail until it hits the last downloaded message. Classic mode gets it as it hits the mailbox.

The only problem is that some features (like junk mail filter) won't work in online mode.
 
Eureka!

Thanks a lot. Your advice solves my problem.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
P VBA to add email address to Outlook 365 rule Outlook VBA and Custom Forms 0
HarvMan Outlook 365 - Rule to Move an Incoming Message to Another Folder Using Outlook 4
B Modify VBA to create a RULE to block multiple messages Outlook VBA and Custom Forms 0
D VBA - unable to set rule condition 'on this computer only' Outlook VBA and Custom Forms 5
CWM550 This rule has a condition that the server cannot process? Using Outlook 1
A rule name into message - how? Outlook VBA and Custom Forms 5
O Mail rule issue Using Outlook 3
A manual rule sends mail to wrong folder Using Outlook 5
Aussie Outlook 365 Rule runs manually but returns the error code "an unexpected error has occurred" when incoming mail arrives Using Outlook 1
bhamberg Finding a rouge rule... Using Outlook 6
D How to get this rule to work Using Outlook 0
B Seeking help with Outlook rule Using Outlook 2
K Run a script rule to auto 'send again' on undeliverable emails? Outlook VBA and Custom Forms 1
G Save attachment run a script rule Outlook VBA and Custom Forms 0
R Rogue Outlook Rule ? Using Outlook 2
P Can I create a Rule that sends me an email when I get a Task? Using Outlook 2
E Having some trouble with a run-a-script rule (moving mail based on file type) Outlook VBA and Custom Forms 5
M How create a Rule to filter sender's email with more that one @ sign Using Outlook 1
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
1 Incorrectly Setup a Rule at Domain level to not allow address from outside domain Exchange Server Administration 2
J Transport Rule to detect Keyword question.. Exchange Server Administration 2
T "Words In Recipient's Address" Rule Causes Outlook To Stop Processing Rules Using Outlook 3
R Outlook Autoforward rule do not work for NDR messages Using Outlook 1
R Setup autofoward rule on a particular folder in Outlook Using Outlook 0
N Rule for "on behalf of" - with changing names Using Outlook 2
S Unable to remove rule outlook 2010 Using Outlook 0
O Outlook 2016 This rule will only run when you check your email in Outlook.... Using Outlook 4
Nadine Rule to move attachments with specific name Outlook VBA and Custom Forms 1
N Outlook Email Rule execution through shortcut keys (VBA codes) Using Outlook 1
dweller Outlook 2010 Rule Ignores VBA Script Outlook VBA and Custom Forms 2
O Rule to move (specific) messages from Sent folder to Specific folder Using Outlook 1
S Adding new Exchange (2016) rule very slow down Microsoft Outlook Exchange Server Administration 0
B Outlook rule run a Script doesn't work Outlook VBA and Custom Forms 1
K VBA BeforeItemMove event create rule to always move to its folder. Outlook VBA and Custom Forms 4
icacream Rule based on sender / wrong sender sent to folder Using Outlook 7
Bri the Tech Guy Run Script rule not running for newly arriving messages Outlook VBA and Custom Forms 25
L Making rule to move email to folder from one O365 domain Using Outlook 1
J Assess content of User Defined Field in Rule Using Outlook 3
S Send email via SMTP - use transport rules to add to senders inbox (then rule to move to sent items Exchange Server Administration 1
A Change order of actions in one (!) rule Outlook VBA and Custom Forms 2
J HELP- Rule to auto strip prepend from external emails Using Outlook 0
A Forward Outlook Email by Filtering using Macro Rule Outlook VBA and Custom Forms 44
A rule to flag messages not working Using Outlook 5
Brian Murphy Exchange Online Everything a Transport Rule should do and cannot Exchange Server Administration 1
J Outlook Rules - Changing auto-submit address in multiple rules, according to rule name Outlook VBA and Custom Forms 0
A saving attachement to folder named the same as rule name Outlook VBA and Custom Forms 0
Jennifer Murphy Can I create a Rule with Or'd conditions? Using Outlook 1
A Rules - how to determine if all conditions in rule are true or false Outlook VBA and Custom Forms 5
Vijay Error in rule- Run a script Using Outlook 1
Ascar_CT Rule behavior analysis - any tools available? Using Outlook 0

Similar threads

Back
Top