A
a
totally new to outlook 2003 and VBA, so please be gentle
yesterday, I added this short piece of code via Tools, Macros, Visual
Basic Editor
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Sub CustomMailMessageRule(Item As Outlook.MailItem)
logfile = "C:\Temp\email.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set fsOut = fso.OpenTextFile(logfile, ForAppending, True)
outputString = "Mail message arrived: " & Item.Subject
fsOut.WriteLine outputString
fsOut.Close
Set fso = Nothing
Set fsOut = Nothing
End Sub
I then created a rule that for each email on this machine, run script
which I called Sample1
To my surprise, it worked fine and wrote in append mode a line for
each received email.
Today, it does not and I can't figure out why it stopped so I removed
the rule, removed the code and added it back in (closed and opened
OL2003 couple times), but it just won't run any more.
What may I have broken? Other than that OL2003 runs fine
yesterday, I added this short piece of code via Tools, Macros, Visual
Basic Editor
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Sub CustomMailMessageRule(Item As Outlook.MailItem)
logfile = "C:\Temp\email.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set fsOut = fso.OpenTextFile(logfile, ForAppending, True)
outputString = "Mail message arrived: " & Item.Subject
fsOut.WriteLine outputString
fsOut.Close
Set fso = Nothing
Set fsOut = Nothing
End Sub
I then created a rule that for each email on this machine, run script
which I called Sample1
To my surprise, it worked fine and wrote in append mode a line for
each received email.
Today, it does not and I can't figure out why it stopped so I removed
the rule, removed the code and added it back in (closed and opened
OL2003 couple times), but it just won't run any more.
What may I have broken? Other than that OL2003 runs fine