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. |
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
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.
|
|
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. |
|
Rasheda Sabir
Posts: 3
Joined: 2007-02-07
|
sorry I meant to say i have set Temporary property of the CommandBar to TRUE. |
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
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.
|
|