Outlook 2007 SP2 issues

Status
Not open for further replies.
Y

YWxhaW5y

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

YWxhaW5y

I should also add that I have reproduced this issue on two different PCs

(workstation and laptop), both with Office 2007 SP2, on XP SP3
 
Y

YWxhaW5y

I should also add that this issue occurs when mail is received from a POP3

account to be delivered into my default folder's inbox.

Strangely, on one of the PC which also has an Exchange folder, mail received

from exchange also delivered into my default folder's inbox, triggers the

rule and runs through the script just fine wihtout generating a run-time

error.

I suspect there may be an issue with the msgItem object when it is received

specifically from a POP3 account.

"alainr" wrote:


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

Ken Slovak - [MVP - Outlook]

I can't repro it here with your sample code on Outlook 2007 SP2 running on

Windows XP. I tested and there were no CDO errors at all. No MsgBox

displayed, but there were no errors.

Have you tried registering the CDO.DLL file again?

Also, why use CDO 1.21 at all under Outlook 2007? You can do just about

anything with that object model that you can do with CDO, plus CDO is

heavily secured and will fire security prompts or fire errors when working

with restricted properties or items, the object model won't do that.

"alainr" <alainr> wrote in message

news:5F76FFC0-3AAD-42F5-8E4A-8162DFAE60B1@microsoft.com...
> Found another thread similar issue reported:

> http://www.outlookcode.net/threads.aspx?forumid=2&messageid=29454
>
 
Y

YWxhaW5y

Thanks for trying the code.

I was using CDO because I had some processes that needed to access

individual MAPI header fields. I wasn't sure if there is a way to map this

ca built-in capabilities without have to do some parsing of text fields (e.g.

parse message headers to extract just the message-ID).

So far I haven't pinpointed the cause to be CDO. However, I will follow

your suggestion and consider modifying my code to avoid the use of CDO, and

instead use the built-in capabilityof of OL2007.

Thanks,
wrote:
> I can't repro it here with your sample code on Outlook 2007 SP2 running on
> Windows XP. I tested and there were no CDO errors at all. No MsgBox
> displayed, but there were no errors.

> Have you tried registering the CDO.DLL file again?

> Also, why use CDO 1.21 at all under Outlook 2007? You can do just about
> anything with that object model that you can do with CDO, plus CDO is
> heavily secured and will fire security prompts or fire errors when working
> with restricted properties or items, the object model won't do that.
 
A

alainr

I have reduced my issue to the simplest possible case. I think the error I

was getting initially in my original code is related to a more fundamental

problem. I have an Outlook vba module that contains only the following code:

-Sub TestRule(msgItem As Mailitem)

MsgBox "test"

End Sub

-In outlook, I establish a rule that triggers this TestRule() macro (e.g. set

to trigger when subject contains the work "test"). When the rule fires and

the the VBA editor window is not open, I will see a message box saying

"Test". However If I set a breakpoint on the line [msgbox "test"] and

trigger the rule, the rule appears to run fine for about 2 seconds and then

outlook crashes with the following error message:

--------
Microsoft Office Outlook has encountered a problem and needs to close. We

are sorry for the inconvenience.

> ...

<Debug> <Send Error Report> <Don't Send
--------
After pressing <Don't Send> Outlook closes (and restarts).

The only references for my projects are:

- Visual Basic For Applications

- Microsoft Outlook 12.0 Object Library

- OLE Automation

- Microsoft Office 12.0 Object Library

The same crash scenario occurs when running outlook in safe mode (Run:

"outlook.exe /safe")

I really think there is a file that got corrupt somewhere. I would like to

try and fix it before I attempt to uninstall/reinstall Office 2007 Ultimate

and related service packs.

At this time I seem to be able to find clunky workarounds the bug by

avoiding certain properties of the Mailitem object in my code and not having

the debugger open when running rules that trigger macros on mail items.

I would be glad to hear any others ideas related to this issue.
 
K

Ken Slovak - [MVP - Outlook]

I cannot reproduce your test scenario at all. Whether the VBA window is

opened or closed and whether or not there's a breakpoint on the MsgBox line

I get no crashes and the rule script macro code runs.

You might want to see if there is any corruption in your Outlook VBA project

file. Close Outlook and find and rename your VbaProject.OTM file to

something like VbaProject.OTM.OLD. Then start Outlook and a new VBA project

file will be created. Try your code in that new VBA project. You will have

to re-link your script macro with the rule.

Another thing to try is to run an Office repair and see if that helps at

all.

"alainr" <alainr> wrote in message

news:2F2FB1EC-EA53-4686-A89E-C56660E87409@microsoft.com...
> I have reduced my issue to the simplest possible case. I think the error I
> was getting initially in my original code is related to a more fundamental
> problem. I have an Outlook vba module that contains only the following
> code:

> -------------------------------> Sub TestRule(msgItem As Mailitem)
> MsgBox "test"
> End Sub
> -> In outlook, I establish a rule that triggers this TestRule() macro (e.g.
> set
> to trigger when subject contains the work "test"). When the rule fires
> and
> the the VBA editor window is not open, I will see a message box saying
> "Test". However If I set a breakpoint on the line [msgbox "test"] and
> trigger the rule, the rule appears to run fine for about 2 seconds and
> then
> outlook crashes with the following error message:

> --------> Microsoft Office Outlook has encountered a problem and needs to close. We
> are sorry for the inconvenience.
> ...
> <Debug> <Send Error Report> <Don't Send
> --------
> After pressing <Don't Send> Outlook closes (and restarts).

> The only references for my projects are:
> - Visual Basic For Applications
> - Microsoft Outlook 12.0 Object Library
> - OLE Automation
> - Microsoft Office 12.0 Object Library

> The same crash scenario occurs when running outlook in safe mode (Run:
> "outlook.exe /safe")

> I really think there is a file that got corrupt somewhere. I would like
> to
> try and fix it before I attempt to uninstall/reinstall Office 2007
> Ultimate
> and related service packs.

> At this time I seem to be able to find clunky workarounds the bug by
> avoiding certain properties of the Mailitem object in my code and not
> having
> the debugger open when running rules that trigger macros on mail items.

> I would be glad to hear any others ideas related to this issue.
>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
J [outlook-users] outlook 2007 Sp2: Error message to quit outlook Using Outlook 9
R Clean out the "Other Calendars" form Outlook 2007 sp2 Using Outlook 1
S Re: Cannot attach a file to an Outlook 2007 template after installingOffice 2007 SP2 Outlook VBA and Custom Forms 3
J Outlook 2007 with BCM - Out of Memory after MSO12 SP2 installation BCM (Business Contact Manager) 4
D Outlook 2007 + BCM & SP2 - windows7 ? BCM (Business Contact Manager) 6
T Appoinments Not Updating after Outlook 2007 SP2 Outlook VBA and Custom Forms 1
C After Office 2007 SP2 install - Outlook 2007 macro no longer worki Outlook VBA and Custom Forms 11
S Outlook 2007 crash linked to gdiplus.dll Using Outlook 0
S Outlook 2007 - Automatic purge fail Using Outlook 0
J outlook 2007 doesn't let me choose which .pst to search Using Outlook 2
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
S Verwendung von Outlook 2007 Using Outlook 0
A Arthur needs help with 2007 Outlook e-mail Using Outlook.com accounts in Outlook 3
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
S outlook 2007 calendar search Using Outlook 6
B Migrate Outlook 2007 to Office 365 Using Outlook 3
X I have met my waterloo trying to resolve embedded graphics problem with outlook 2007 and now 2016 Using Outlook 1
R Outlook 2007 only loads some appointments Using Outlook 0
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3
J Outlook 2007 Hide Messages Option not Available Using Outlook 2
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 4
S Outlook 2007 Calendar instant search problem. Windows 7 Using Outlook 0
B Server errors Outlook 2007 Using Outlook 1
S Reboot of frozen windows7 results in changed outlook 2007 settings Using Outlook 1
S Outlook 2007 printing wrong email address at top of page Using Outlook 8
M Configure outlook 2007 to accept digital signatures Using Outlook 2
D Outlook 2007 crashes when opening an email Using Outlook 2
R New chap saying hello and needing advice on Outlook 2007 thumbnails Using Outlook 3
icacream From Outlook 2007 to 2016 ! Using Outlook 9
vodkasoda Object could not be found Error in Outlook 2007 Outlook VBA and Custom Forms 5
S Outlook 2007: Address Cards allow entering text! Why? Using Outlook 3
S View Appointment in Text Wrap in Outlook 2007 Month Calendar View Using Outlook 0
L Outlook 2007 Separate the Send/Receive functions Using Outlook 2
M Outlook 2007 Contacts Glitch: Creating a new email Using Outlook 1
C Move from Outlook 2007 Enterprise (MOE) to Outlook Pro plus 2007 Using Outlook 1
J reinstalling Outlook 2007 asking for user name & password Using Outlook 14
P outlook addin unloaded in office 2007 Using Outlook 0
B Fonts in Outlook 2007 Using Outlook 4
R Add Exchange Account to existing POP3 Outlook 2007 Profile Using Outlook 0
C out of space in file group Outlook 2007 Using Outlook 2
A Moving archived contents in Outlook 2007 back into working folders Using Outlook 0
P Outlook 2007 Email Categorization using VBA Outlook VBA and Custom Forms 1
M Unable to Configure Gmail Account in Outlook 2007 Using Outlook 1
R Outlook 2007 or 2010 - Lock Down Functionality Outlook VBA and Custom Forms 3
S Outlook 2007, windows 10 Font size Using Outlook 1
Diane Poremsky Manually create a POP3 account in Outlook 2007 Using Outlook 0
J Can Click to Drag Custom Form Field But Cannot Drop When Designing in Outlook 2007 Outlook VBA and Custom Forms 2
L Outlook 2007 Font Using Outlook 3

Similar threads

Top