register word dll without starting word process

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

register word dll without starting word process
 
Bart Van Bossche




Posts: 11
Joined: 2014-01-09
Hi,

Our clients have our program already installed and we don't want them to install additional software for each addin we want to create.
So we want to register our addin dll when our main program is started.

We use the following line of code:
ShellExecute(0, 'open', 'regsvr32.exe', PWideChar('/s '+ sAddinDllFilename), nil, SW_HIDE);

The big problem is that when we use this line of code, the word process is launched each time our program starts.
Is it possible to register our dll without starting Word?
Posted 29 Apr, 2014 05:17:01 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Bart,

The "register add-in" operation doesn't start the add-in's host application. If commenting out this code line prevents Word from being started, then it looks like there's a problem in the code of your add-in. Do you use "new Word.Application", CreateObject and similar things in your add-in? Also note that the add-in actually starts working only after the host application sends an event. Depending on the start scenario and the Office version used the very first event can be either AddinInitialize or OnRibbonBeforeCreate (see events of the add-in module). For this reason doing anything Word-related in the constructor(s) or class-level initializers doesn't make sense; actually this may cause the problem that you are having.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 30 Apr, 2014 01:43:57 Top
Bart Van Bossche




Posts: 11
Joined: 2014-01-09
Hi Andrei,

Thanks for the help.
We use a TDcsWordHandler to get combine functions of your components with functions of our application to communicate between those two.
I created this when I first started using your component to get information from a Word document and combine them with information of our application and show that combined information on a task pane in Word.
When I try to do that, I need the Word application to be running. This is created in the initialize of my TDcsWordHandler.
We decided to wait with that taskpane, but the code was still there. That was what causing the start of the Word application each time.
When we want our taskpane back, we'll need to look into that. :)

Thanks a lot for solving this issue!

Sincerely,

Bart
Posted 30 Apr, 2014 02:42:34 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
You are welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 30 Apr, 2014 03:31:32 Top