View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
David Sisson[_3_] David Sisson[_3_] is offline
external usenet poster
 
Posts: 17
Default Outlook Object Model via Excel -- return code after send?

In my Outlook 2000 book, in a paragraph describing canceling an
event...

"...when an event is cancelled, the event still fires, but the
consequences of the event is cancelled. For example, if the user
failed to enter data in the required field LastName, the 'Write' event
can be used to warn the user and cancel the saving of the edited item,
as we see in the code in Listing 4-14.

Function Item_Write()
if Item.LastName = "" then
msgbox "Need to enter last name"
Item_write = False
end if

End Function
'end quote

So perhaps some code in the send event (not tested)

Function Item_Send
If Item_Send = false then
Answer = Msgbox "Do you really want to cancel the Save?"
If Answer = 1 then
Item_send = false
else
Item_Send = True
end if
end if
End Function