howto invoke ApplicationEvent OnSendItem?

I

Irfan Ahmed

Hi,

I am trying to catch SendItem event when a new email is sentin MS Outlook.
My addin is in Visual C 6.0. Can someone help me how to catch the event when
"Send" is clicked and email is sending.
I want to add my custom header at that time. What will be the function to
add new header in the email headers?

Thanks,
-Irfan
 
D

Dkds.Naidu

I am giving just rough idea. It is Exchang Client Extension.

Are you trying with OOM or ECE???

This is for ECE.

Try with this:

1. Add ExchEntryPoint into your .def file.
EXPORTS
ExchEntryPoint @1 PRIVATE

2.
LPEXCHEXT CALLBACK ExchEntryPoint()
{
//override this method
}

3. Just Override IExchExt & IExchExtMessageEvents interfaces.

like:


class CExchangeAddin : public IExchExt, // It loads extension objects in
all contexts
public IExchExtMessageEvents // Traping send
button events

{
private: ULONG m_ulRefCount;
public: CExchangeAddin(); ~CExchangeAddin();
private: //For Members
//IUnknown methods
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
STDMETHODIMP QueryInterface ( REFIID riid,void** ppvObj);

//IExchExtMessageEvents method
STDMETHODIMP OnRead(LPEXCHEXTCALLBACK lpeecb);
STDMETHODIMP OnReadComplete(LPEXCHEXTCALLBACK lpeecb, ULONG ulFlags);
STDMETHODIMP OnWrite(LPEXCHEXTCALLBACK lpeecb);
STDMETHODIMP OnWriteComplete(LPEXCHEXTCALLBACK lpeecb, ULONG ulFlags);
STDMETHODIMP OnCheckNames(LPEXCHEXTCALLBACK lpeecb);
STDMETHODIMP OnCheckNamesComplete(LPEXCHEXTCALLBACK lpeecb, ULONG ulFlags);
STDMETHODIMP OnSubmit(LPEXCHEXTCALLBACK lpeecb);
STDMETHODIMP_(VOID) OnSubmitComplete(LPEXCHEXTCALLBACK lpeecb, ULONG
ulFlags);

}

}

5. Just add the string in your registry at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\Client\Extensions


4.0;C:\Irfan.dll(path of your dll);1;111111111111111(Context
map);1111111111(Interface map)
 

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