S
SeekerOfTruths
Hi, I'm having a little difficulty with OpenSharedItem in the Outlook 2007
add-in that I'm writing.
The purpose of the add-in is to detect when the user opens (double-clicks)
certain items and to retrieve an alternative item which has been stored
elsewhere (i.e. not in Exchange) and present this item in an inspector window
instead of the original item.
I can hook into the Open event no problem, and when this event fires I
perform a check on the item being opened to see if it needs special
treatment. If it does I acquire the alternative item to be opened (as a file
on disk), use OpenSharedItem to give me back a object referencing the item on
disk, create a new inspector window using this new item and then cancel the
open event on the original item.
This all seems to work fine, except for the fact that when I close the
inspector window containing the alternative item, a handle to the file on
disk remains open which prevents the file on disk from being deleted. This
would suggest that there is still an object somewhere that is referencing the
item on disk, but I''m not sure where the reference is or how to go about
tracking it down (I've set all the instances that I'm aware of to null in my
code).
If anyone could give me suggestions on what might be wrong and/or how to
track down the problem, I'd be very grateful.
Thanks,
SeekerOfTruths
add-in that I'm writing.
The purpose of the add-in is to detect when the user opens (double-clicks)
certain items and to retrieve an alternative item which has been stored
elsewhere (i.e. not in Exchange) and present this item in an inspector window
instead of the original item.
I can hook into the Open event no problem, and when this event fires I
perform a check on the item being opened to see if it needs special
treatment. If it does I acquire the alternative item to be opened (as a file
on disk), use OpenSharedItem to give me back a object referencing the item on
disk, create a new inspector window using this new item and then cancel the
open event on the original item.
This all seems to work fine, except for the fact that when I close the
inspector window containing the alternative item, a handle to the file on
disk remains open which prevents the file on disk from being deleted. This
would suggest that there is still an object somewhere that is referencing the
item on disk, but I''m not sure where the reference is or how to go about
tracking it down (I've set all the instances that I'm aware of to null in my
code).
If anyone could give me suggestions on what might be wrong and/or how to
track down the problem, I'd be very grateful.
Thanks,
SeekerOfTruths