PC Review


Reply
Thread Tools Rate Thread

Office::COMAddIn::put_connected NOT WORKING under VIsta

 
 
Gancev
Guest
Posts: n/a
 
      21st Jul 2008
Hi,

I add my code below. The problem is that in Vista the function
put_connected is not working.
On Windows XP is working in all combination.On Windows Vista if I start
Outlook with "Run as admin" it works, otherwise not.
I used the link http://msdn.microsoft.com/en-us/library/bb386106.aspx and
copy all keys from Local to current user but still not working until I
delete this reg key
:"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Outlook\Addins\OneNote.OutlookAddin.12"
My purpose is to disable One Note add in for specific messages only, and
the solution should work even if user start Outlook without using "Run as"

void DisableOneNoteAddin(bool state){
CComPtr<Outlook::_Application> spApp = GetMainApplication();
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 OutlookItems"))
{
if(state) spAddin->put_Connect(VARIANT_FALSE);
else spAddin->put_Connect(VARIANT_TRUE);
}
}}}}

Thanks,
Stojan

 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      21st Jul 2008
If the addin is registered to HKLM then it's likely that Vista is preventing
disabling the addin due to its security, since a HKLM registration is an
administrative installation. I don't see any way around that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Gancev" <(E-Mail Removed)> wrote in message
news:8A755ED8-3CC3-4DA0-A4C1-(E-Mail Removed)...
> Hi,
>
> I add my code below. The problem is that in Vista the function
> put_connected is not working.
> On Windows XP is working in all combination.On Windows Vista if I start
> Outlook with "Run as admin" it works, otherwise not.
> I used the link http://msdn.microsoft.com/en-us/library/bb386106.aspx and
> copy all keys from Local to current user but still not working until I
> delete this reg key
> :"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Outlook\Addins\OneNote.OutlookAddin.12"
> My purpose is to disable One Note add in for specific messages only, and
> the solution should work even if user start Outlook without using "Run as"
>
> void DisableOneNoteAddin(bool state){
> CComPtr<Outlook::_Application> spApp = GetMainApplication();
> 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 OutlookItems"))
> {
> if(state) spAddin->put_Connect(VARIANT_FALSE);
> else spAddin->put_Connect(VARIANT_TRUE);
> }
> }}}}
>
> Thanks,
> Stojan
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Office::COMAddIn::put_Connect not working under VISTA Gancev Microsoft Outlook Program Addins 0 21st Jul 2008 12:30 PM
I find that Office 97 is not working on Vista yorkmak Windows Vista General Discussion 3 24th Apr 2008 04:13 AM
Ditributing ComAddin's & ActiveX-dll's in Vista Peter T Microsoft Excel Programming 0 6th Nov 2007 03:13 PM
Windows Vista working with office. =?Utf-8?B?TWFyayBH?= Windows Vista General Discussion 2 11th Jun 2007 07:18 PM
Office 2007 not working (on Vista) =?Utf-8?B?SnVsaWU=?= Windows Vista Installation 1 9th May 2007 03:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:18 PM.