Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-03-2023, 12:55 AM
whistler1 whistler1 is offline apply template change to all documents Windows 11 apply template change to all documents Office 2016
Novice
apply template change to all documents
 
Join Date: Jul 2023
Location: gateshead, UK
Posts: 8
whistler1 is on a distinguished road
Default apply template change to all documents

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


Reply With Quote
  #2  
Old 07-03-2023, 04:51 AM
Guessed's Avatar
Guessed Guessed is offline apply template change to all documents Windows 10 apply template change to all documents Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,159
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #3  
Old 07-03-2023, 05:28 AM
Charles Kenyon Charles Kenyon is offline apply template change to all documents Windows 11 apply template change to all documents Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,464
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I assume that it is styles, and not other formatting or text that you want to update.
Reply With Quote
  #4  
Old 07-03-2023, 06:58 AM
whistler1 whistler1 is offline apply template change to all documents Windows 11 apply template change to all documents Office 2016
Novice
apply template change to all documents
 
Join Date: Jul 2023
Location: gateshead, UK
Posts: 8
whistler1 is on a distinguished road
Default

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
Reply With Quote
  #5  
Old 07-03-2023, 08:37 AM
Charles Kenyon Charles Kenyon is offline apply template change to all documents Windows 11 apply template change to all documents Office 2021
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,464
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
I have a lot of documents based on one custom template. I have edited the template and new documents based on it are fine. However, I need the changes implemented on existing documents as well. I tried Andrew's macro.
Quote:
I would like to update any/all changes to the template so styles, layout, page size, margins ...
Andrew's macro deals with styles, which is why I queried what it is you were trying to do. He provided it because your original post showed the dialog to update styles. I join him in advising that you not leave that box checked if you use it. When you save a document, it should be unchecked.

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:
Word is a very complex piece of software that Microsoft tries to make appear easy. For easy tasks, it is easy. For more complex ones, you need to learn how it works, under the hood. Basic Concepts of Microsoft Word - from Shauna Kelly I have been working with Word for more than thirty years and still can't claim to understand all of how it works. Participating in forums like this allows me to keep learning and sometimes be surprised.


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.
Reply With Quote
  #6  
Old 07-03-2023, 04:24 PM
Guessed's Avatar
Guessed Guessed is offline apply template change to all documents Windows 10 apply template change to all documents Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,159
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #7  
Old 07-03-2023, 09:16 PM
whistler1 whistler1 is offline apply template change to all documents Windows 11 apply template change to all documents Office 2016
Novice
apply template change to all documents
 
Join Date: Jul 2023
Location: gateshead, UK
Posts: 8
whistler1 is on a distinguished road
Default

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?
Reply With Quote
  #8  
Old 07-03-2023, 09:54 PM
Guessed's Avatar
Guessed Guessed is offline apply template change to all documents Windows 10 apply template change to all documents Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,159
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #9  
Old 07-03-2023, 10:05 PM
whistler1 whistler1 is offline apply template change to all documents Windows 11 apply template change to all documents Office 2016
Novice
apply template change to all documents
 
Join Date: Jul 2023
Location: gateshead, UK
Posts: 8
whistler1 is on a distinguished road
Default

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.
Reply With Quote
Reply



Similar Threads
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
apply template change to all documents Apply Heading Style When Combining Documents snot369 Word 1 01-13-2017 11:04 AM
apply template change to all documents How to apply a list style to multiple Word documents? MrSnrub Word 4 06-19-2013 07:32 AM
apply template change to all documents Apply template to multiple documents Oliver Beirne Word VBA 2 04-24-2012 04:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft