That doesn't seem to be actually deleting an Inspector, instead it just
deletes a UserProp that holds a number. I'm not sure what that number is or
where it's derived but deleting a UserProp shouldn't cause an error unless
it's something I don't know about.
The action of deleting a UserProp in a Close event may also be limited now,
just not documented. That would not be unheard of...
The original reference to what I was talking about is at
http://support.microsoft.com/default...b;EN-US;929593, related to
Outlook 2007. Shortly after Outlook 2007 RTM a security update was posted
that extended this behavior to Outlook 2003 SP2. I discovered that watching
a customer's code break and asked the PM who owns the Outlook object model
about it and found out that had been backed into Outlook 2003 without
warning. Nice breaker of existing code. The reason was it sometimes caused
Outlook to crash, although I've never seen that here.
The applicable text from that KB is:
Some methods no longer work in the Inspector_Close event or in the
Item_Close event
In versions of Outlook that are earlier than Outlook 2007, a crash may occur
if you use one of the following methods in the Inspector_Close event or in
the Item_Close event: • The Inspector.Close method
• The Item.Close method
• The Item.Move method
• The Item.Delete method
To prevent this problem, a design change was made in Outlook 2007 so that
these methods no longer work in the Inspector_Close event or in the
Item_Close event. When you try to use these methods in the Inspector_Close
event or in the Item_Close event in Outlook 2007, you receive the following
error message:
The item's properties and methods cannot be used inside this event
procedure.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Tom at GSD" wrote in message
...
Okay Ken I found the issue that was causing the problem and it was
deleteing
an inspector in the close event.
The programmer added the inspector to a User Property by doing the
following.
NewInspector.CurrentItem.UserProperties.Add("EPIns pectorIndex",
olNumber).Value = m_LastInspector
Then in the close event buried deep in the code I found the following.
Set oUserProp =
m_oInspector001.CurrentItem.UserProperties.Find("E PInspectorIndex")
If Not (oUserProp Is Nothing) Then oUserProp.Delete
This was truly a bizaar problem. Why does this not show up on development
machines? Do you have any idea?