Thanks for the answer.
In IExchExt::Install I only seem to get messages for the email form
(EECONTEXT_READNOTEMESSAGE and EECONTEXT_SENDNOTEMESSAGE). I need the
contact form. Also, I don't succeed in adding the button to the newly opened
form, only to the Outlook application.
I installed it in registry with
4.0;D:\Projects\VC\TextExt\Debug\TestExt.dll;1;11111111111111;1111111
I am using Outlook 2000.
Here is some code I am using, if you can tell me if I am on the right
track... Code here is without any error checking and releasing of the
interfaces.
// Member pointer
Outlook::_ApplicationPtr m_pOApp;
// In IExchExt::Install get the Outlook pointer and save it like this:
IOutlookExtCallback* IOut = NULL;
IUnknown * punk = NULL;
IDispatch *IDisp = NULL;
pmecb->QueryInterface(IID_IOutlookExtCallback,(LPVOID*)&IOut);
IOut->GetObject(&punk);
hr = punk->QueryInterface(IID_IDispatch,(LPVOID*)&IDisp);
hr =
IDisp->QueryInterface(__uuidof(Outlook::_Application),(LPVOID*)&m_pOApp);
OApp = m_pOApp;
// Then in IExchExtCommands::InstallCommands I add the button like this.
Outlook::_ApplicationPtr pOApp = OApp;
Outlook::_ExplorerPtr pExp = pOApp->ActiveExplorer();
Office::_CommandBarsPtr pCmdBars = pExp->CommandBars;
Office::CommandBarPtr pMainBar = pCmdBars->ActiveMenuBar;
Office::CommandBarPtr pToolBar = pCmdBars->GetItem("Standard");
Office::_CommandBarButtonPtr pItem =
pToolBar->Controls->Add((long)Office::msoControlButton,vtMissing, vtMissing,
vtMissing, true);
What rows should be changed here to add the button to the new form instead?
Regards Tobias