Programmically set template security on 1 .DOT file

M

Mark Mears

I have been asked to repackage a third party application that installs a Word
Template with a toolbar. The .DOT file is always placed in the Office
Startup folder so that the user can click in the toolbar to activate the
template. While I have been able to get this working by performing a
FileCopy type of operation in the MST, when the user opens Word 2003, they
get a security warning.

I need to be able to script the sequence of checking the “Always trust
macros from this publisher†checkbox and clicking on the “Enable Macrosâ€
button at the time of installation of the third party application so that
each user does not get prompted with this warning. Can you provide me with
the registry settings necessary to be created or modified to accomplish this?
Office 2003 is a prerequisite to installing the application so it will
always be present at install time.

The customer is running Office 2003 with Service Pack 2, on a Windows XP SP2
platform. Please let me know if you need any additional information.
 
S

Suzanne S. Barnhill

FWIW, if you install the template in the Word Startup folder instead of the
Office Startup folder, then it will be covered by "Trust all installed
templates and add-ins," and there will be no security message.
 
M

Mark Mears

What is that location? I looked in the Microsoft Office structure but did
not see anything that looked like it.
--
Thanks,
Mark


Suzanne S. Barnhill said:
FWIW, if you install the template in the Word Startup folder instead of the
Office Startup folder, then it will be covered by "Trust all installed
templates and add-ins," and there will be no security message.
 
J

Jay Freedman

Its default location is C:\Documents and Settings\<username>\Application
Data\Microsoft\Word\STARTUP, although it can be altered in the Tools >
Options > File Locations dialog. It's specific to the user profile for
<username>.

You may have missed it because the Application Data folder and everything
under it is a hidden folder, so you need to turn on display of hidden
folders in Windows Explorer (Tools > Folder Options > View).

More info at
http://www.word.mvps.org/FAQs/Customization/WhatTemplatesStore.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
M

Mark Mears

Is there a way that a new user would autiomatically receive the template? If
I could add it to the Default User profile I could see where that would work,
but Default User does not have a Word folder under Application Data. As
well, the third party application places the DOT file in the Office11\Startup
folder.

Would it accomplish what I want by using the CMW and importing ther CER file
from there and distributing it to the machines?
 
J

Jay Freedman

The footnote in the article I cited before explains why the Office11\Startup
folder isn't a good place for any templates.

You didn't say what kind of repackaging program you're using, but in general
you need to find the login name of the current user and use that to create
the template's installation path. The code in
http://www.word.mvps.org/FAQs/MacrosVBA/GetCurUserName.htm may help, if you
can translate it into whatever scripting language your software uses.

I don't know the answer to the questions about the CMW. You might get
answers in the microsoft.public.office.setup or
microsoft.public.word.vba.general newsgroups.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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