Hi Ken,
Sorry, I am using google to post directly
I am following the thread of pascal with regards to redirect or
disable the save function. here is your reply:
------------
To simplify you would have to handle the NewInspector event of the
Inspectors collection and wrap each new Inspector with a class module
that handled events for the items opened in that Inspector. Each item
type you wanted to handle would have a Save event that could be
trapped and your code in that event handler would do what you wanted
at that point.
This would not handle changes made to items in a folder view if
in-cell editing was enabled for that folder, you'd have to handle that
by setting up event handlers in a wrapper class for Explorer.Selection
and update that each time the folder or selection changed.
This should be done using an Outlook COM addin, so the first place to
start is by downloading the ItemsCB COM addin sample in VB6 code for a
look at an Explorer wrapper and the best practices for Outlook addins,
including workarounds for well-known Outlook COM addin bugs.
The Explorer wrapper can be used as a model for an Inspector wrapper.
I've also posted code for Inspector wrappers in this group in the past
and we've had many discussion threads in here about Inspector
wrappers. You can Google for some of that information using "Inspector
wrapper" as a search term.
----------------
I am trapping the SelectionChange Event of the explorer and placing
the selection in a Item Wrapper that traps the Write event, but I
found that saving the message directly from the explorer does not
trigger the Write event.
Basically, my code is something like.
private sub oExplorer_SelectionChange()
ItemContainer.clear
for i = 1 to oExplorer.Selection.count
ItemContainer.add(oExplorer.Selection(i))
next
end sub
and then in the ItemContainer.add method, I create a ItemWrapper
object for the item being added, the itemWrapper object handles the
Write event and sets cancel to true. however, when I try to save from
the explorer, the message still gets saved. I tried debugging and
found that the Write event handler was never called.
Thanks,
Zhen