Response out of MS Outlook dialog box

A

Adi

I am using VSTO with C# for creating Outlook Add-ins. I need to get
the response from the dialog box that pops up during various
operations like Save, Send, Close etc. The dialog box usually
contains
options like:
1. Save and send the item,
2. Don't save but keep the item open.

How can I get the response out of this dialog box?
 
K

Ken Slovak - [MVP - Outlook]

None of those dialog boxes provide outputs that you can receive or handle.

You can guess, if the user chooses to send then the Item.Send event will
fire. If they save the Item.Write event will fire and so on, but that's
about it.
 
A

Adi

Thanks for the reply.

My situation is kind of wierd where in I need to handle the save event
on Outlook appointment item. Within save event handler, I need to get
all item related information like entryId etc. (you can assume that
the save is must for me to proceed further) for which I save the item
first and then proceed further. But if the user changes Date/Time on
the MEETING item and Sends update, then the dialog box pops open when
I call Save within the Save event handler.

If user selects "Don't save but keep the meeting open", I need to
cancel the Send event.

Is there a work around for this issue?

Thanks.
 
K

Ken Slovak - [MVP - Outlook]

You can cancel Send inside the Send event handler. You can't really do what
you want from the Write event, but you can cancel the event, set a flag
there to indicate the event was cancelled and then call Save later from a
timer event handler or something like that. The flag would tell the Write
handler what state the code was in.
 

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