document templates - propagate changes to existing documents?

Posted on 2011-10-27
Last Modified: 2012-06-21
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 :-)
Question by:DrTribos
    LVL 15

    Expert Comment

    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?
    LVL 14

    Author Comment

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

    LVL 92

    Accepted Solution

    Changes in a template will not propagate to existing documents based on that template.
    LVL 14

    Author Comment

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

    LVL 76

    Assisted Solution

    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

    LVL 92

    Expert Comment

    by:Patrick Matthews
    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 :)
    LVL 14

    Author Comment

    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,
    LVL 14

    Author Comment

    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

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    When creating Microsoft Word-based forms there may be a need to have a form field repeated throughout the whole document. For instance, with a company name, you may want this information repeated automatically throughout the document rather than man…
    A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
    This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
    This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now