Results 1 to 12 of 12
  1. #1
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word (2003 SP3)

    Hi Avraham, welcome to the lounge!

    If I can quote you : "I want to hear from anybody who has experience of trying this method." This, in my opinion, is quite a unique request, so you may end up waiting a long time for someone who has actually tried this before. Don't get me wrong here...This forum is a marvelous place and certainly one of the best to get an answer to your queries, however I could recommend that you give your theory a try and if you hit a problem then let us know and we can attempt to help you solve it. If of course your theory works, then let us know by sharing your knowledge. Besides the fact that you can get answers to queries here, its also a great place to share.

    PS: I am not one of the resident"gurus" in MS Word, so if you prefer to wait for another reply from one of the Word Wizards (of which this lounge has plenty), then feel free. The lounge is fairly quiet over the weekends though... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Regards,
    Rudi

  2. #2
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    179
    Thanks
    3
    Thanked 0 Times in 0 Posts

    How to Create an Integrated Template Suite

    Hi all,

    RE: How do you Create an Integrated Word Template Suite (using 'Inheritance' or Other)?


    I have a client for whom I created a 'standard' template. A requirement has now appeared for a 'short' template. By this we mean a template for keeping short documents as short as possible, i.e., to forfeit the chapter cover page, reduce the font size of some of the heading titles, and of course reduce the amount of front material. However, the fact remains that 99% of the template remains the same, e.g., body text styles, list styles, table styles, macros, autotexts. Thus, if at some point I have to update a detail within the common 99% of the template I will have to do it in two places. And of course, if later we need one or more additional template variants the problem just gets multiplied.

    So wouldn't it be nice if …

    ... I could make a 'Common' template that contains all the common stuff, and then the variants will be just minimal, 'presentation' templates that inherit (note the presence of the word 'inherit') from the 'Common' template, this latter template being the one that actually contains all the real guts.

    The Word feature that seems to me to be the obvious candidate for trying to implement such an inheritance solution is the:

    *Global templates and add-ins list*

    (in *Tools | Templates and add-ins | Templates*).

    My idea for using this would be that the variant templates would inherit the 'Common' template by adding the 'Common' template into the *Global templates and add-ins list*. The actual documents would then connect with the appropriate template variant, either in the normal way by assigning it to *Document template*

    (in *Tools | Templates and add-ins | Templates*)

    or by adding it to

    *Global templates and add-ins list*

    On paper, it seems to me the idea should work. However, I want to hear from anybody who has experience of trying this method. Can it actually work? Are there pitfalls? Would programming support make it work? Or will it not work at all? And if not, why not?

    And is there another way of achieving a solution?

    If I can't just simply store all the common stuff in a common 'Base' template, then this is going to be a really bitter pill to swallow. This is going to be as bad as all the other big holes in Word, like not providing built-in flexible user-oriented conditional text, no comfortable hiliting colors, unreliable lists, etc.


    FYI, we are using Word 2003.

    Thanks,

    Avraham

  3. #3
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    179
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: How to Create an Integrated Template Suite

    Thanks for the response, Rudi.

    >> you may end up waiting a long time for someone who has actually tried this before.
    Well, maybe somebody has tried it.

    In addition, I am hoping people will also notice my request for any other type of solution.
    ------------

    I think my problem is not a "detail of a widget" sort of problem but rather a general Word system problem that any serious, professional Word power user is going to hit eventually. After all, *is it so unlikely* that a corporation using Word is going to want an integrated suite of templates?

    Yes, I have time. I have already waited some time on two other good forums.

    Again, thanks.

    avraham

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: How to Create an Integrated Template Suite

    It has been a few years since I looked at this, so apologies if it has become obsolete in recent versions.

    Unfortunately, Word normally consults a limited set of sources of determining the styles in a document:
    <UL><LI>A document inherits its "style DNA" from its attached template. In the case of the "blank document template," this is Normal.dot. In other cases, it would be a custom template.
    <LI>An attached template does not refer to sources outside itself for its own style definitions; templates do not have attached templates.
    <LI>Changing the attached template normally does not change the styles in the document (but Word can be tweaked to do that).[/list]So in most cases, Word users have to maintain templates individually. Global templates usually play no role with respect to styles; they tend to be used for supplying macros and AutoText entries, and modifying toolbars.

    That raises the question, can we use template code to propagate styles? Yes, you can, for example by automating the Organizer. But it would introduce a considerable amount of overhead to do this on the opening or creation of every document on every computer. So depending on the frequency of updates, it might not be worth it.

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: How to Create an Integrated Template Suite

    I have done templates similar to what you describe by using Autotext entries - and so would advise you to look in this direction. From the users perspective, when they create a new file from the template they are presented with a list of possible document types they want to create. When they choose one, that specific content is added to the current document from the autotext entries included in the template. If you need to modify a couple of styles based on that document type you would add the modifications to the same code that inserts the autotext.

    The basic method in developing this - build a template which contains ALL of your components (toolbars, styles, keyboard shortcuts, macros) and then add to this all the autotext entries (for each of your starting documents). Next you build a user form which opens when a new document is created and allows the user to choose an entry (corresponding to your autotext entries) from the list. If you have a few document types where some styles have different definitions, you can make those isolated changes through code at this point. Dumbing the interface down for simple document variants might be as easy as hiding a power users toolbar in the template.

    This is relatively easy to describe and a breeze to maintain but there is plenty of code and development to get this working just right. The end result is worth the effort as you have a single template which provides the starting point for all your potential documents. The template customisations will be common for all documents and the users won't need to learn the differences between templates or dig around to find exactly the right template. Your management of the template becomes very easy and additional document types ('templates') are simple to add and can be done without coding changes if you set the template up correctly.

    Your stab at "like not providing built-in flexible user-oriented conditional text, no comfortable hiliting colors, unreliable lists, etc." sounds like you are migrating from other software, perhaps Framemaker. How did you handle the integrated template suite in that software?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    179
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: How to Create an Integrated Template Suite

    And thanks for the welcome, Rudi!

    - avraham

  7. #7
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    179
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: How to Create an Integrated Template Suite

    Thanks for the response, jscher.

    Yes, you are right, at least up to Word 2003, inclusive. For some reason the sages at MS decided that "global templates" and add-ins will let you import everything apart from styles.
    I wonder if there was an ideology behind that, or the coding was just too complex? And I wonder why, in a world that was already object oriented, they prevented us from implementing template inheritance.

    Anybody know if this has changed in Word 2007? I expect not. IMO, the differences between versions seem to usually be in the number of widgets rather than in fundamental mechanisms.

    Thanks,

    - avraham

  8. #8
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    179
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: How to Create an Integrated Template Suite

    To Andrew:

    Thanks for the response.

    I was also thinking of a programmatic solution in that direction. But not being able to simply chain and inherit templates is a bitter pill to swallow.

    Now just thinking this through out loud…

    Wrt holding delta variations of the template body example* (see *note below) in autotexts, I suppose that instead, for each template type I could hold its WHOLE template body example in a separate autotext. Maybe that's a bit extreme but at least then I wouldn't have to bother working out how to insert the autotexts in the right places. Anyway, I would probably first give it a try to hold only the deltas in autotexts in order to keep down the template's size (in bytes).

    And now a rhetorical question: and so what would be the "default" appearance of the template body example? Answer: the parts of the template that are common, i.e., the base template; unless, of course, it is decided to keep all the *complete* template body alternatives in autotexts, and in that case the only sensible content for the default template body would be to keep it blank.

    But a problem: where would I keep the autotexts' contents? Ok, they are kept in the autotexts, but they all first had to appear typed out in a document somewhere to first define them and store them. True, they can be thrown away; but I have never liked to throw away autotext sources. Just in case a template would become corrupt I like to keep a backup of the autotext sources so at least I would not have to recreate them. I suppose I could have a repository document for storing those variants.

    >> Your stab at "like not providing built-in flexible user-oriented conditional text, no comfortable hiliting colors, unreliable lists, etc." sounds like you are migrating from other software, perhaps Framemaker.

    Actually it is not the case that I am migrating from other documentation software; it is just that I have been working with Word for quite some time, and I am aware (I hope) of what I would expect from a professional documentation system to support my ideas of the way things should be done. On the other hand, it is true that I have also been a programmer for many years in all sorts of environments and so I suppose I am often trying to impose all sorts of programming paradigms on the Word (or other) documentation environment that I am using.

    >> How did you handle the integrated template suite in that software?

    Thinking about FrameMaker, of which I also have some knowledge, its Master Pages mechanism has advantages and disadvantages wrt Word's template mechanism. Wrt FrameMaker's ability to implement an integrated template suite, I think it is even less capable than Word. At least Word *looks* as if it could support the idea, the MS sages just have to extend the "add-in template "feature to be able to also import styles. But I don't know FrameMaker well enough to be sure. Does FrameMaker support any type of external template add-ins? Anybody?

    Btw, where is Darkest Italia? Italy?

    ----------------------------------------------------------------------------
    *By "template body example" I mean the document body of the template that looks just like the document body of a Word .DOC file and is usually used to contain examples of each style in the style set the template offers. I hope I was clear.
    ----------------------------------------------------------------------------


    Thanks,

    - avraham

  9. #9
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    179
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: How to Create an Integrated Template Suite

    I think it could be a little difficult to sell the programming/autotexts idea to my client...

    - avraham

  10. #10
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: How to Create an Integrated Template Suite

    I'm not sure that you would want a cascading chain of templates to format documents and provide content since Word documents are often emailed and sent outside the company and this would break unless the file structure was maintained. Cascading stylesheets in html (and relative links) only really work because the files are viewed in position on that server - take a file out of that structure and it doesn't work unless you take an additional step to package everything. Web developers understand this but not average Word users. Word files are used very differently to web documents and the same cascading principles don't fit so well with the model.

    Rather than repeat the entire document contents for each variant of boilerplate document I would recommend the following method. The default (no code) template contains all the common content such as cover page, TOC etc. You deal with variable text in this area such as document title by using fields to the document properties. Headers and footers can include these fields too. You might want to add several fields to the user form where the user types content in which is then placed in the document properties (and hence is available to appear in multiple places throughout your document). In some documents which don't require the usual common content, the code could delete this content before adding the content from autotext. In all the others, just place the document specific text in the autotext entry and insert this via code in the relevant location.

    You can keep a backup of the autotexts if you wish but I would be inclined to just store a copy of the template if you were worried about corruption. Recovering the autotext content is simple anyway down the track as the content would have come from an existing document somewhere. I usually use a macro to create a document which contains all the template autotext entries to allow checking and updating of this content.
    <pre>Dim sAuto as Variant
    For Each sAuto in ActiveDocument.AttachedTemplate.AutoTextEntries
    Selection.TypeText "=================================" & vbCr
    Selection.TypeText sAuto.Name & vbCr
    sAuto.Insert Where:=Selection.Range, RichText:=True
    Selection.TypeText vbCr & vbCr
    Next sAuto</pre>

    I don't know enough about Frame to tell you what it is capable of with its templates but I would presume that it doesn't cascade styles either. In Word, although the styles don't cascade, you could use code to import from other templates but this doesn't happen automatically.

    and Darkest Italia is where I am living at the moment - near Turin in Northern Italy - where it snowed yesterday and doesn't look like getting any warmer today.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  11. #11
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    179
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: How to Create an Integrated Template Suite

    >> I'm not sure that you would want a cascading chain of templates to format documents and provide content since Word documents are often emailed and sent outside the company and this would break unless the file structure was maintained.

    Word would have no problem with this. Word's style storage works in a different way from XHTML/CSS. When a Word doc uses a style, the style is then copied and stored locally in the doc *and you can't change this even if you wanted to*. Btw, autotexts are another story; the doc can use external defined autotexts and does NOT copy them locally. So if you want to send a standalone Word doc outside of the company (since some clients get confused an accompanying template, so I am told…) you can't use externally defined autotexts.


    >> Rather than repeat the entire document contents for each variant of boilerplate document I would recommend the following method.

    I also don't want to "repeat the entire document" (you mean template contents?), which was the whole point of my original post. I suppose we are agreeing on this.
    "Boilerplate document". Right! That's the expression I was looking for. Thanks!


    >> The default (no code) template contains all the common content such as cover page, TOC etc. You deal with variable text in this area such as document title by using fields to the document properties. Headers and footers can include these fields too.

    All this stuff I already do for a regular single template.


    >> In some documents which don't require the usual common content, the code could delete this content before adding the content from autotext.

    Btw, IMO, that's an oxymoron. I define common content as content required by *all* documents without exception. Makes life easier, for sure, IMO.


    >> I usually use a macro to create a document which contains all the template autotext entries to allow checking and updating of this content.

    Thanks for the code sample.


    =================================
    In conclusion:

    - Maintain a single template, an when opening it or when creating a new document based on it (e.g., by double clicking the template's entry in WE) a user form is always displayed requiring you to select a template variant.

    - Based on the user's selection, the boilerplate document or user document is created accordingly

    - Styles are modified accordingly, as necessary

    - Any other modifications performed accordingly, as necessary, e.g., autotexts or macros are assigned from a list of variants

    That's the best that can be done?
    Anybody know if Word 2007 supports cascading templates, so making this whole thread obsolete?
    Fini?

    Great thanks,

    avraham

  12. #12
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: How to Create an Integrated Template Suite

    It sounds like you understand pretty much everything thats been said already.

    The oxymoron of the non-common content was my clumsy attempt to describe documents such as forms, letters and other such working documents that would also benefit from the template customisations but don't require a cover and toc that the other larger documents produced by the template will do. It is always unclear when talking about templates since the Microsoft model of a Word template is far more than just boilerplate content but most people think of a template as just boilerplate content.

    Since you understand the styles exist in the document after creation then I am not understanding why you still think it is so important for the styles to cascade automatically from multiple templates. You can always run some code to import styles from a multitude of external templates if you wish but I obviously don't understand why this is necessary. That said, I don't need to understand it as it is you and not me doing the template. Don't hold your breath waiting for someone to step in and tell you that Word 2007 will give you this ability. The html capabilities of Word are best left unexplored IMO. Perhaps a cascading solution lies within the xml-xsd-xsl area of Word 2003/2007 but again, you won't find many people on this forum creating xml solutions for Word documents.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •