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 = fspenTextFile(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
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 = fspenTextFile(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