Write event not ocurring on save

Y

Yahya Saad

Dear All,

I am trying to capture the write event of a mail item on save or save
as, but it is not firing. It only occurs when the item is closed and the
user is asked to save his changes. Please advise.

Regards,
Yahya
 
K

Ken Slovak - [MVP - Outlook]

Also use the Close event. One or both will fire. Just maintain a form code
module level Boolean to tell whether your Write/Close code has fired already
to you don't run it twice.
 
Y

Yahya Saad

Thanks, but my problem is that the write event is not capturing the save and
save as methods.

Regards
Yahya
 
K

Ken Slovak - [MVP - Outlook]

You have to work with the events that are provided. If you trap both Close
and Write you will get all conditions where saving applies.
 
Y

Yahya Saad

Thank you, it is working fine,
I still have one question, how can I differentiate between the auto save
(when the form is opened for a period) event and the normal write event.

Regards,
Yahya
 
K

Ken Slovak - [MVP - Outlook]

There are a number of different ways the Write and Close events will fire.
You can manually save an item, close it and get prompted to save, click on
the X at the top right and get prompted, have an autosave occur and so on.
You'll have to test each combination to see what fires when and where.
Offhand I forget all the combinations and results.

There might be something about it on www.outlookcode.com, you can check
there and see if Sue has any articles about that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top