Outlook mail form doesn't close after clicking on Send Button


N

Narottam

Hi,

I have custom messages(custom message class) and have written the callbacks
to handle context menus.
For Reply context menu i have written a handler C++/ATL. Below is the xml
file entries and code handler for this.

<commands>
<command idMso="Reply"
onAction="OnContextMenuClick"/>
</commands>

Below is the code
===========

STDMETHODIMP CAddin::OnContextMenuClick(IDispatch* ribbonControl,VARIANT*
CancelDefault)
{
if(our custom class msg selected)
do operation for open form
------
CancelDefault->boolVal = VARIANT_FALSE;
else
for normal IPM.Note messages
CancelDefault->boolVal = VARIANT_FALSE;
}

Now for custom messages, outlook form is opened with custom message as
attachment which is exactly what is expected.
I have also implemented below interfaces in my formviewer class like MFCMAPI
IMAPIMessageSite
IMAPIViewAdviseSink
IMAPIViewContext

After Clicking the "Send" button in Outlook e-mail form the "SubmitMessage"
of IMAPIMessageSite is called and everything returns S_OK and the message is
also send successfully, but form doesn't close. It remains on the foreground.
Is there is something need to tell to Outlook to close the mail form
specifically?

I couldn't find any help for this. Can someone let me know if there is
something wrong?


Thanks,
Narottam
 
Ad

Advertisements

K

Ken Slovak

I don't do C++ code so I can't comment directly on the code, but you need to
make sure to release all of your objects and sinks for the item to be able
to close. If necessary, when the Send() event finishes you can explicitly
call Inspector.Close() to force the Inspector window to close down.
 

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

Similar Threads


Top