PDA

View Full Version : Adding styles from a template.dot



island17
10-20-2008, 10:42 AM
Hello All

I couldn't find my answer in the Knowledge base, so here goes my question.

I would like to be able to load styles in word, when I add a template. And have those styles removed when I unload the template.
Any help would be appreciated.

Russ

lucas
10-20-2008, 10:49 AM
If I understand, you want certain styles to be available in only one certain template and not others, correct so far?

If that is so, you should be able to add the styles to the template itself before you save it as a template file. Those styles will not be available to other documents.

fumei
10-20-2008, 12:18 PM
Put the styles you want in a .dot file.

This can be loaded, and unloaded dynamically as a global template...an "add-in".

Load the add-in...the styles are available (in any document).

Unload the add-in...the styles are not available.

This is different from using a template file to clone a new document. In that case, any new document cloned from the template will have (as Steve mentions) the styles in the template. If you only want specific styles used for specific documents, this is the way to go. Cloning a template, as ONLY documents cloned from that template will have the styles in that template.

I mention globals as you are using the word "load".

Remember you can "load" a global template (with its styles) but NOT have it "installed". There is a difference.

' this ADDS the template file to the list of
' available add-ins
' AND installs it (Install:=True)

AddIns.Add FileName:= _
"FULL PATH\TestX.dot" _
, Install:=True


' this uninstalls it and style contained
' are not available, BUT the add-in template
' IS still listed!
AddIns( _
"FULL PATH\TestX.dot" _
).Installed = False

' this removes the add-in template
' from the available list
AddIns( _
"FULL PATH\TestX.dot" _
).Delete

NOTE! the path to the global template does NOT have to one of the known Word template folders (UserTemplates or WorkGroup Templates). It can be ANY folder, including a network folder, as long as it is a fully qualified and legal Path.

island17
10-21-2008, 01:04 PM
Thanks for your help. This should get me started.

Have a great day