Attached Templates

B

Brenda A. Reid

Because I have all our templates on the server, I end up having trouble
replacing the templates after editing because of "open files". I'd like to
start detaching templates from ordinary documents upon opening.

I have a global macro file that gets saved in everyone's startup folder.
I'd like to add the following vba to this file:

With ActiveDocument
.UpdateStylesOnOpen = False
.AttachedTemplate = ""
End With

so that whatever document gets open, if there is an attached template, it
would get removed. Eventually (I hope), none of my templates will show up
under "open files" on the network. Would this work? What would I call the
macro to have it automatically run no matter what document gets open?

Tks . . . Brenda
 
D

Doug Robbins - Word MVP

See the article "Distributing macros to other users" at:

http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm

Also see

----- Original Message -----

From: "Chad DeMeyer" <cjdemeye at bechtel dot com>

Newsgroups: microsoft.public.word.vba.addins

Sent: Thursday, August 12, 2004 4:10 PM

Subject: Re: Need to change how we distribute firm templates?




Colleen,

Using a logon script to copy latest version of add-in templates to StartUp
folder is probably the best solution for the templates containing

macros, etc. However, I would answer your objection to using the

Templates location for the other templates with this:

When a user has a document created from one of those templates open and

are connected to the network, a file lock is in fact created that prevents
the template itself from being opened with Modify access. However, these
file locks can be released, with no adverse affect to the end users who
created them, by using any of a number of standard utilities that close

resources on a network. The only catch is that the person using the

must have adequate permissions on both the network share and the Workgroup
Templates folder itself, in other words Admin rights. On my Windows 2000
box, I can do this through the UI with Start>Settings>Control
Panel>Administrative Tools>Computer Management>Action>Connect to another
computer... type name of network server>System Tools>Shared Folders>Open
Files, find any open resources for that template, right-click and select
'Close open file'. Even easier is to use the command line utility OFL,
which when used with the right switches will automatically close any open
resources connected to a specified template.


Chad


--
Hope this helps.


Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
B

Brenda A. Reid

Sorry if I was confusing. I do have a file called mcmacros.dot file that
gets copied to everyone's startup folder during login.

My script works if I run it as a regular macro after I open a document. I
need it to run automatically everytime someone opens up a document. I am
just having trouble getting it to work using AutoOpen. What I need to know
is where do I put in in my vba window (under regular macros, etc.), what do
I call it?
 
D

Doug Robbins - Word MVP

The code needs to be in a

Sub Autoopen()

End Sub

routine in the mcmacros.dot file

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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