• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

document templates - propagate changes to existing documents?

So I feel I should know the answer to this, but not sure if there is some trickery that I am unfamiliar with... so...

When I create a new document from a template it will be based on the template - that bit I get.  

If I have 100 documents, all created from the same template and I change the styles in that template AND I have "automatically update document styles" turned on under templates and addins, then my changes should be reflected in the documents....

But... what if (for example) I decide to change the page margins in the template for making it easier to put into a ring binder OR change the layout of my header.... is there a way to automate those type of changes - layout as opposed to styles.... ???

My thoughts are it will require much coding... not sure if CSS can help, don't know much about it.

I'm asking because I want to develop a template that compartmentalises information, at the drop of a hat I want to be able to rearrange the information on my page without loosing links from 1 item of information to another...  tall order?

Thoughts appreciated :-)
2 Solutions
Look at


Then search for the word 'template'

The second or third instance explains how to set margins at the template level.

and if that's not what you're looking for, can you give me a better idea of what it is you're looking for - something beyond formatting?
DrTribosAuthor Commented:
Hi there,

Thanks for you comments, I guess you are referring to this:

The new default settings are saved in the template on which the document is based. Each new document based on that template automatically uses the new margin settings.

This is not quite what I'm after... only new documents will have the revised margins set...  I was wondering if there was a way to apply the new margins to existing documents...  

I did something similar on a website using CSS - I was flying in the dark and with my eyes shut, the result was pleasing but I'm not really sure what I was doing.  

By way of clarification... Imagine I have many Word documents based on a custom template.  Over the years document authors have "tweaked" margins, fonts, colours, tables... etc.  Now, what was supposed to look like a "set" of uniformly documents looks like the output of a "personal creativity and self expression workshop" - I simply want my "clinical and uniform" look back.  I am wondering how far I can go by resetting documents back to the look and feel of the original template...

That said... imagine the above scenario is the future and I have a chance to change it... What should I do to set myself up for easy street so everyone's creative, self expressive tweaks can be easily reset?

Hope this helps....

Patrick MatthewsCommented:
Changes in a template will not propagate to existing documents based on that template.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

DrTribosAuthor Commented:
Hi matthewspatrick - thanks for the confirmation... is it possible with CSS?  Or am I looking at coding all the way?

Coding needn't be too complicated.

If you have all the documents in a folder, you can start with this:
Sub ChangeMargin()
    Dim strFileName As String
    Dim doc As Word.Document
    Dim strFolder As String
    strFolder = "C:\MyFolder"
    strFileName = Dir$(strFolder & "\*.doc*")
    Do Until strFileName = ""
        Set doc = Documents.Open(strFolder & "\" & strFileName)
        doc.PageSetup.LeftMargin = CentimetersToPoints(2)
        doc.Close wdSaveChanges
        strFileName = Dir$()
End Sub

Open in new window

Patrick MatthewsCommented:
If by CSS you mean Cascading Style Sheet, I am not sure how that would help here, since we are not talking about web pages :)
DrTribosAuthor Commented:
Hi Graham - sorry for delay to your comment, my reply to your post seems to have dropped :-/

Ultimately I want to (for the most part) replace the template with a configuration file.  I am thinking it should be possible to move blocks of information around a document should the template change.  The idea is that each item (block of information) has attributes which specify where the information should be positioned on any given (compatible) template... Further some information can be updated on the fly - e.g. if a logo is updated in the template config file then it would be updated in the document the next time it is opened (I know this can be done by linking images, however these files need to be portable which I think makes the linked image technique a bit flakey?)  

The main goal, however, would be to enable information to move around dynamically... so if the config file is changed from having the logo on the LSH to the RHS then the document will be rearranged to match.  Same concept for images, different types of text, etc. I figure the document will be laid out in tabels.  I guess it would help you to know that in my document the information is compartmentalized...

Hi Patrick - sorry for the delay in reply, I can find some information on the web about using MS Word with CSS - not sure of the limitations.

I am not anticipating this being a small project, certainly not one that I will be able to code.

Kind regards,
DrTribosAuthor Commented:
bump - any thoughts using a config file to format a word document?  Any ideas for an efficient way of setting up a config file?

Let me know if more explanation is required...

many thanks


Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now