![]() |
#1
|
|||
|
|||
![]()
I have a LOT of documents based on one template.
I have edited the template and new documents based on it are fine. However I need the changes to be implemented on the old files too. Is there a way to do this without going to each one in turn and ![]() |
#2
|
||||
|
||||
![]()
It is a really bad idea to leave this setting turned on for your documents - especially if the template attached is Normal.dotm. If you send your document to other people, the styles will refresh to their template instead of yours so you will never be able to predict what the document will look like on other machines.
However, you can add a macro to your template to either refresh styles at the click of a button or perhaps as you open an existing document. The macro can do the same thing but by leaving that checkbox unticked, it won't run on documents that you have sent to other people. Code:
Sub AutoOpen() ActiveDocument.UpdateStyles End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
![]()
I assume that it is styles, and not other formatting or text that you want to update.
|
#4
|
|||
|
|||
![]()
Hi Charles, I would like to update any/all changes to the template ("C:\Users\john\AppData\Roaming\Microsoft\Template s\LyricsW.dotx")
so styles, layout, page size, margins ... I tried Andrew's macro but it doesnt seem to do anything either on opening nor on running the macro. Sub AutoOpen() ActiveDocument.UpdateStyles End Sub |
#5
|
|||
|
|||
![]() Quote:
Quote:
![]() First, read What is the relationship between a Microsoft Word document and its template? and What happens when I attach a new template to my document? or How do I copy content and settings from a template to a document? by Shauna Kelly MVP and Attaching a Different Template in my chapter on Templates. I am a lawyer, and for me, documents are historical records and should not be changed. You create a document and transmit or use it. You save it. Ten years later, you look at it to see what it is you said when you created it. These days, I often save a document that I have finished as a pdf so I won't be tempted to change it. When I want to reuse it for a different client, if it is not already a template, I make it into one that is designed for future use on new documents. Templates are used to create future documents. You probably should be creating and using templates. Templates have never simply been the stuff that Microsoft provides with Word. They are one of the most powerful components of Word. Here is my chapter on them: Templates in Microsoft Word . To adapt an existing document to a different/revised template, create a new document based on the template. Then copy everything from the old document into the new one. Save the new one, but not over the top of the old one until you are sure you no longer need the old one. This will not change everything but is as close as you are going to get. Any remaining issues need to be dealt with manually. Features that can be used to more easily update templates (and documents) to new standards include:
![]() perplex2.png
To apply to all documents... The process I set out is far more than just checking a box, and you were trying to avoid that for multiple files! I explained what to do with one file. It would be possible to write a macro that would open an existing document, create a new document based on its attached template (assuming the template is still attached), copy the content from the existing document to the new one and save the new one with the old name in a different folder. This would not be a trivial task for a novice. I spent a couple of hours trying to develop such a macro and could not do it. That does not mean than no one could, of course. Any such macro is not going to work for all documents or templates. Then use a bulk process to run the macro on all files in a folder. Here are two such free utilities: I again urge you, if these are for re-use, make them templates. Last edited by Charles Kenyon; 07-03-2023 at 09:11 PM. |
#6
|
||||
|
||||
![]()
Refreshing existing documents to better align with updated templates is a complex puzzle. Importing the template styles is really just the tip of the iceberg but it is a relatively safe thing to do. Other things you might choose to update have the potential to lose document-specific information or require a huge amount of adjusting specific items.
Lets say you amend the template to: 1. Change the cover page layout 2. Change the front matter (Table of contents field, document history table, acronym list, approvals table etc) 3. Change the header/footer layouts 4. Change the page setups 5. Change the table formatting For all of those template-level changes, it would be highly problematic to just automate the updating to match the new template. Unless you have religiously used mapped Content Controls (linked to document metadata) in all those legacy docs then you can't just paste in header/footer/cover/front matter without also needing to re-instate the document specific information. For instance, the title of the document is different for each document so pasting in a template version of the cover removes the document title. Similarly, changing the page widths to match a template page setup change means you may also have to visit the table and graphic widths for all those items. It is absolutely POSSIBLE to create macros to adapt existing documents but if you are only just now asking about how to do it then it is too late. Existing document setups have to be configured in such a way that you already thought about needing to update the template BEFORE you actually need to do it.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#7
|
|||
|
|||
![]()
Thanks to both of you. Perhaps my "intuitive" approach was unsiuitable.
What I need to do is adapt all my documents to better fit a new format. They were originally made to print on an A4 page on paper. I now need the same documents to better fit a screen with a resolution of 768 * 1366 which is a reasonable match to a legal paper size 21.6 * 35.6 cm and as its on screen I now need only very narrow margins. The documents mostly all text - nothing fancy, no forms, tables, front matter, cover page etc. or -only about 10% - text with an image. I realise I will have to edit any that dont work well in the new format. Sorry if my image misled you, the documents are all based on templates. Could I perhaps create a copy, then batch apply a new template to all the documents in the folder? |
#8
|
||||
|
||||
![]()
Yes you can run a macro to batch apply a Template to all documents in a folder. It would be safest to do this on a copy of all those documents.
The macro can refresh the styles from the template and potentially also do some other tasks if you are trying to set it up for a screen by screen output. The workflow of the macro would be: 1. Loop through all documents in a folder 2. Attach the desired template 3. Refresh styles from the template (possibly update theme colours/fonts too) 4. For each section in the document, change the page setup to legal & landscape and set the margin sizes. Possibly also set column count if also changing that. 5. Resize any graphics to new page width (if oversized) 6. Possibly export as PDF* 7. Save and Close * I assume when you start talking about a screen size of 768x1366 that you are also converting the Word document to PDF. Is that right?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#9
|
|||
|
|||
![]()
yes thats right Andrew they are displayed on screen as pdfs as the system wont always have office to be able to display a "document"
.. but lets keep it simple and just apply the new layout - page size, margins etc. It displays in portrait. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to apply a new template file? | New Daddy | PowerPoint | 1 | 07-11-2019 12:11 AM |
Open Userform once and apply the same selection to multiple documents | Formd | Word VBA | 2 | 12-12-2017 10:11 AM |
![]() |
snot369 | Word | 1 | 01-13-2017 11:04 AM |
![]() |
MrSnrub | Word | 4 | 06-19-2013 07:32 AM |
![]() |
Oliver Beirne | Word VBA | 2 | 04-24-2012 04:49 AM |