Removal of templates

D

Davor

Is it possible to remove (uninstall) advertised templates (templates that was
installed with Office, like: "Elegant fax", "Elegant Letter", etc... ) from
computer using VBA?
I would like to remove them from "templates" dialog ("File"->"New...").
I know that it can be done through Office setup application, but how to
automate this because I have to do it on 200+ computers in our network.
 
P

Pete Bennett

These templates are usually the ones stored inside the "1033" folder.

You should be able to do something like this:

Sub DelTemplates
Dim sPath as String
Dim sName as String

sPath="C:\Program Files\Microsoft Office\Office\Templates\1033\"

sName = Dir (sPath & "*.dot")

While Len(sName) > 0
Kill sPath & sName
sName = Dir()
Wend

End Sub


Alternatively, if you don't want to actually delete the templates, you can
hide them from the "New Document" screen by just applying the "Hidden" flag.
You can still create documents from Hidden templates using VBA (Document.Add
Template:="Hidden Template.Dot").
 
D

Davor

I already tried that, but no luck.
When you delete templates in that folder ( or "hide" them) they still can be
seen on "File->New..." dialog. Interesting, if view is set to "Details", file
length for each deleted template is 0 KB ?!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top