Copy Command

B

Brenda A. Reid

Would anyone have some vba code that I could put into a letterhead template
that would copy that template, close the original and then paste it into a
blank document so that the original template is considered "closed"?

My problem is that when I have edited the template and try to copy it back
to the network, there is always open files so therefore I cannot replace or
copy over the original template.

Brenda
 
D

Doug Robbins - Word MVP

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

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

The following post from a few years back may be of use to you as well:

----- 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

Thanks very much Doug but for whatever reason my systems admin is not
wanting to copy the templates locally whenever someone logs into the
network.

Do you have the macro request to do the copy as I'd like to give that a try.
 
D

Doug Robbins - Word MVP

Brenda,

To do what you describe in your original message, you would just use
File>New, then select the existing template, and click the Template radio
button in the Create New section of the dialog, then click OK.

You could use a macro to do that, but it's hardly worth it.

You are still going to have the problem however of substituting the new
template that you create in this way for the original one if other people
have documents that are created from that template open on their machine.

Time to have a serious discussion with the network administrators (or their
superiors to explain that they are compromising the efficiency of the
office).

--
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