Vista issue with COMAddIn

S

stojan

Vista issue with COMAddIn
Hi All,

I add my code below. The problem is that in vista the function put_connected is not working. Is there any other way to disconect addin in vista.

Thanks,
Stojan

void DisableOneNoteAddin(bool state)
{
CComPtr<Outlook::_Application> spApp = GetMainApplication();
if(spApp == NULL)
return;

CComPtr<Office::COMAddIns> spAddins;
CComPtr<Office::COMAddIn> spAddin;
spApp->get_COMAddIns(&spAddins);

if(spAddins)
{
long numaddins;
spAddins->get_Count(&numaddins);

if(numaddins>0)
{
for(int i = 1; i<=numaddins; i++)
{
CComBSTR name;
VARIANT var = CComVariant(i);

spAddin =spAddins->Item(&var);
spAddin->get_Description(&name);

if(name == _T("OneNote Notes about Outlook Items"))
{
if(state)
{
spAddin->put_Connect(VARIANT_FALSE);

}else
{
spAddin->put_Connect(VARIANT_TRUE);

}


}

}

}
}

}
 

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