redirect or disable save button or file>save

G

Guest

When the user clicks on Save button or File>Save, I'd like that another
function would be called or that the function would be disabled. how could I
do for both ?

this would be done in outlook, using VB6.

thanks for your answer.

pascal
 
K

Ken Slovak - [MVP - Outlook]

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

Pascal Couvreur

it worked!
thanks for the tip.

Ken Slovak - said:
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.
 
H

hint

Hello Ken,

You are referring to the "Write" event right? I tried trapping that
event but it doesn't seem to get triggered although the documentation
says it should. Any ideas?

Thanks,
Zhen
 
Top