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
"Dmitry Streblechenko" <(E-Mail Removed)> wrote in message
news:#O#(E-Mail Removed)...
> You can do it in exactly same way, only context will be different
> (EECONTEXT_VIEWER). Or you can use Outlook Object Model from your
extension
> (use IOutlookExtCallback) to add the buttons using OOM.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
>
> "Tobias Svensson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello,
> > I am working on a Outlook client extension in VC++. I have a button
added
> to
> > the standard toolbar in Outlook. Now I also would like to add the same
> > button when the user opens the Outlook form for contacts. (existing
> contact
> > or new contact)
> >
> > How can I detect when a form containing contacts is opened and how do I
> add
> > the button?
> >
> > Thanks...
> >
> >
>
>