Write_event problem

S

sparkle_guy

I have a form that when the write event is triggered (i.e. before "save" or
"save as" actions) some code is run. However the code also runs when the
form is sent. I have set the "save copy of sent messages" in properties to
off but the code still runs when the form is sent as well as when it is
subsequently saved. Any ideas what is going on or how to stop it.

Thanks Paul
 
S

Sue Mosher [MVP-Outlook]

You need to coordinate between the two events with a module-level flag:

Dim m_blnSent ' Boolean

Function Item_Send()
m_blnSent = True
End Function

Function Item_Write()
If Not m_blnSent Then
' do stuff with Item
End If
End Function
 

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