activate with command line switch

Add-in Express™ Support Service
That's what is more important than anything else

activate with command line switch
activate with command line switch  
Don McDonald




Posts: 34
Joined: 2011-09-14
Hi
I have written a school testing program that locks the user. If I deploy the addin it immediately locks up word as if a user was writing a test. Is there a way I can activate the program with a command line switch?
ie. windword.exe /myaddin
I need it to deactivate when the user quits the test.

Thanks
Don McDonald
Posted 30 Sep, 2011 16:38:43 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Don,

Please take a look at the Command-line switches for Microsoft Office Word 2007 article. Pay special attention to the /ladd-in command line switch. Is it what you are looking for?
.NET, Extended MAPI, Windows Phone & RT
Posted 03 Oct, 2011 04:36:50 Top
Don McDonald




Posts: 34
Joined: 2011-09-14
Hi Eugene
No this is not what I need. I need a command line to register my addin and a command line to unregister my addin after I am done.

Don
Posted 03 Oct, 2011 09:21:13 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Don,

Unfortunately Word doesn't provide such command line parameter. Instead, please use the adxregistrator.exe utility for registering and unregistering add-ins. You can read more about the command line format in the Deploying per-user Office extensions via an MSI installer or Deploying per-machine Office extensions via an MSI installer articles on our technical blog.
.NET, Extended MAPI, Windows Phone & RT
Posted 03 Oct, 2011 09:29:51 Top
Don McDonald




Posts: 34
Joined: 2011-09-14
Hi Eugene

I do not have a problem installing this to a computer.

The problem that I have is that I do not want it to be active all the time. I would like to activate it( register ?) from another program by command line and deactivate it( unregister ? ) after word exits. Your articles do not explain how to do this.

Do I need to reinstall and uninstall every time I want to run it?

Don
Posted 03 Oct, 2011 13:20:13 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Don,

It looks like you are interested in the Connect property of the COMAddin class in Office. Using the Connect property you can load/unload a per-user add-in dynamically. Please read more about this way in the HowTo: Communicate with a COM add-in from a standalone application article on our technical blog. Is it what you are looking for?
.NET, Extended MAPI, Windows Phone & RT
Posted 03 Oct, 2011 14:37:41 Top
Don McDonald




Posts: 34
Joined: 2011-09-14
Thanks for the update. I believe this would answer my question. I have switched to leaving the addin run all the time and only have it activate on certain conditions which I believe will work better. I have one simple request. I have tried your control scanner but I can't seem to locate the button to view and manage add-ins. I wish to disable this.
I have tried disabling ComAddinsDialog and DocumentTemplate but neither seemed to work.

Don McDonald
Posted 06 Oct, 2011 22:08:10 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Don,

What Office version do you use? Anyway, if you want to prevent users from disabling your add-in you need to disable the Tools | Options (Outlook 2000-2007) and File | Options (Outlook 2010) main menu. But this is not the right strategy because users will not be able to chage their settings in Outlook at all.
.NET, Extended MAPI, Windows Phone & RT
Posted 07 Oct, 2011 00:13:39 Top
Don McDonald




Posts: 34
Joined: 2011-09-14
Hi Eugene

For this program I just want to prevent the users from disabling my addin. The software is a testing program and I need to keep the security high. If possible I would like to just disable the addin not the other options. I am using word 2007 and will migrate to 2010.

Don
Posted 07 Oct, 2011 09:09:57 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Don,

There is no any trivial way for preventing users from disabling your add-in (except disabling/hiding the Options button in Outlook, of course).
.NET, Extended MAPI, Windows Phone & RT
Posted 07 Oct, 2011 09:20:30 Top