Close New Mail Window programmatically

  • Thread starter Thread starter Steffen Heinzl
  • Start date Start date
S

Steffen Heinzl

Hi!

If I create a new mail object with my Outlook Application, is it
possible to close the gui element representing the mail programmatically?
I want to abort sending the mail and close the mask.

Best Regards,
Steffen
 
Steffen said:
Hi!

If I create a new mail object with my Outlook Application, is it
possible to close the gui element representing the mail programmatically?
I want to abort sending the mail and close the mask.

Best Regards,
Steffen

Perhaps more specifically:

In my send handler I have a reference to an inspector and my created mail.
I can call close on my mail, but I get an exception that my mail cannot
be closed during Send. So is there a workaround or does anyone know if
there is something like an "after send" event?
 
You can cancel the send, set up a timer that fires after the Send event
finishes and let the timer handler close the item. If you send it then it
should close automatically after it's sent.
 
You could also copy the mail, send the copy, and then close the
original email's inspector.
 
Johannes said:
You could also copy the mail, send the copy, and then close the
original email's inspector.
Thanks. I didn't notice that the Inspector also has a Close method.
 
Back
Top