Close New Mail Window programmatically

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
 
S

Steffen Heinzl

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?
 
K

Ken Slovak - [MVP - Outlook]

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.
 
J

Johannes

You could also copy the mail, send the copy, and then close the
original email's inspector.
 
S

Steffen Heinzl

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.
 

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