Specifying the dot file

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

Specifying the dot file
ADX commandBar and Normal.dot 
Rasheda Sabir




Posts: 3
Joined: 2007-02-07
hello,

When adding a commandBar (addin in Word), it is possible to to specify the dot file that this is saved in? As defualt, it is saved in Normal.dot, but I want to be able to specify a separate dot file just for my addin.

Thanks.
Posted 07 Feb, 2007 07:44:28 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Rasheda Sabir,

You can try to use the WordApp.CustomizationContext property in the OnAddInInitialize event handler.


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.

Posted 07 Feb, 2007 07:59:09 Top
Rasheda Sabir




Posts: 3
Joined: 2007-02-07
Hi Dmitry,

Thanks for your quick response!

I have used this and it sort of works. In the OnAddInInitialize event i put: WordApp.CustomizationContext := WordApp.ActiveDocument;
and also set the Temporary property of the CommandBar to false. After registering the addin, I open up Word and and it's all fine, but if I open another instance of Word i get an error "The addin has fired an exception unspecified error", the first instance on the Word document has 2 of my command bars.

How could actually create a dot file and save the commandbar to it?

Thanks again.
Posted 07 Feb, 2007 10:32:56 Top
Rasheda Sabir




Posts: 3
Joined: 2007-02-07
sorry I meant to say i have set Temporary property of the CommandBar to TRUE.
Posted 07 Feb, 2007 12:38:05 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Rasheda Sabir,

The code of Add-in Express doesn't suspect that you will use the CustomizationContext property and it is the reason of the exception and appearing of 2 command bars. At the very beginning of Add-in Express development we tried to realize this and use the CustomizationContext property but we had to reject the idea. Theoretically all this can work if you create a template, put it into the Word startup folder (<SYS_DRIVE>:Documents and Settings\<USER_NAME>\Application Data\Microsoft\Word\STARTUP\) and use this template as a customization context but you can use this at your own risk. BTW, I don't recommend using this property because the majority of Word add-ins retain their settings in the standard template - Normal.dot. Moreover, MS Word itself may misbehave if you change the CustomizationContext property.


Posted 07 Feb, 2007 13:08:03 Top