Hi all,
I'm writing an outlook addin, trying to stop email sends on certain
conditions.  I'm using OnItemSend callbacks that has a cancel
parameter which if set to True, will cancel the send.  It's not
working :(.  I'm calling:
 self.applicationEvents = DispatchWithEvents(application, ApplicationEvent)
with
 class ApplicationEvent:
   def OnItemSend(self, item, cancel):
      print "OnItemSend"
      cancel = True
and desperate, also tried:
 class ApplicationEvent:
   def OnItemSend(self, item, cancel):
      print "OnItemSend"
      cancel = True
      return cancel

I've confirmed that the handler is getting called, but the cancel
parameter seems like it's not getting back to outlook.

The makepy has
#  def OnItemSend(self, Item=defaultNamedNotOptArg,
Cancel=defaultNamedNotOptArg):
as the prototype on gen_py\ApplicationEvents.py.

Any ideas?  One thing is that the VB call is
 Sub object_ItemSend(ByVal Item As Object, Cancel As Boolean)
which I suspect Cancel is passed by reference?  If so, is this handled
by the mechanisms in DispathWithEvents?  If not, how does one do it?

Thanks
Dave
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to