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);
}
}
}
}
}
}
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);
}
}
}
}
}
}