A
alainr
Since I have applied Office 2007 SP2, some of my VBA macros triggered by
rules on incomming mail generate a run-time error. I have reduced the
problem to the following:
1) Create a rule to run a script when a message containing "test" in the
subject arrives (this works fine)
2) The script configured to run is:
Sub TestMapiRule(msgItem As Outlook.MailItem)
Dim objSession As New MAPI.Session
objSession.Logon "", "", False, False, 0 ' Use the existing Outlook
session
MsgBox "test"
objSession.Logoff
Set objSession = Nothing
End Sub
3) When a message arrives and triggers the rule I get the following runtime
error:
Run-time error '-2147417850 (80010106)'
Automation error
Cannot change thread mode after it is set
<End> <Debug>
- The error is triggered by the line "objSession.Logon..." and the
message box never appears.
If I choose the <Debug>, Outlook crashes completely (actually as soon as I
open the VBA editor to attempt any debugging of this issue, Outlook
completely crashes). Selecting <End> kills the script in its tracks and
normal operation of Outlook resumes.
Could anyone with Outlook 2007 SP2 please try to reproduce this issue?
Please let me know if you have observed similar or related issues since
applying OL2007 SP2.
Please let me know if you have any ideas on the possible causes for this
issue.
* Runing Windows XP SP3, all code was running fine before applying SP2 and
nothing was changed just before or after SP2 was applied.
rules on incomming mail generate a run-time error. I have reduced the
problem to the following:
1) Create a rule to run a script when a message containing "test" in the
subject arrives (this works fine)
2) The script configured to run is:
Sub TestMapiRule(msgItem As Outlook.MailItem)
Dim objSession As New MAPI.Session
objSession.Logon "", "", False, False, 0 ' Use the existing Outlook
session
MsgBox "test"
objSession.Logoff
Set objSession = Nothing
End Sub
3) When a message arrives and triggers the rule I get the following runtime
error:
Run-time error '-2147417850 (80010106)'
Automation error
Cannot change thread mode after it is set
<End> <Debug>
- The error is triggered by the line "objSession.Logon..." and the
message box never appears.
If I choose the <Debug>, Outlook crashes completely (actually as soon as I
open the VBA editor to attempt any debugging of this issue, Outlook
completely crashes). Selecting <End> kills the script in its tracks and
normal operation of Outlook resumes.
Could anyone with Outlook 2007 SP2 please try to reproduce this issue?
Please let me know if you have observed similar or related issues since
applying OL2007 SP2.
Please let me know if you have any ideas on the possible causes for this
issue.
* Runing Windows XP SP3, all code was running fine before applying SP2 and
nothing was changed just before or after SP2 was applied.