View Single Post
  #3   Report Post  
Ian
 
Posts: n/a
Default

Hi Charles,

Thanks. you have been very helpful. wouldnt you prefer it if Word just did it?

Cheers
Ian

"Charles Kenyon" wrote:

This can be done. I do it. Once set up, it is very easy to maintain.

For instance, with letterhead...
I have a basic letterhead template that has all my information on it. The
things I would be changing a
Header info
Footer info
Styles
The headers and footers in the basic template contain one or more bookmarked
pieces of information.
The basic template has a document variable "BaseName" which is the name of
the base template.
The base template is stored in the letters and templates folder of the
workgroup templates folder.

Subsidiary or dependent templates are created by opening the base template
and using SaveAs. They can be saved to any location. The document variable
is not changed in subsidiary templates.

When a new letter is created using any of the templates, an AutoNew macro
checks the document variable against the attached template name. If they are
not the same, it attaches the new document to the base template (updating
the styles) and updates the bookmarked areas; if they are the same it simply
opens.

The macros I use are below.
Sub AutoNew()
' First part operates only in template other than "Kenyon Legal
Letter.dot"
' Brings in Headers and styles from "Kenyon Legal Letter.dot"
' Revised 28 January 2004
'
' Designed to allow changes in main letterhead headers or styles to
' automatically propogate in forms created by using SaveAs
' from that template.
'
' The name of the Base Template ("Kenyon Legal Letter.dot") is stored
' as a document variable in that template. That variable's
' name is "BaseName." Templates created using the base template
' will also have the same variable.
'
' If the name of the base template is changed, you need to change
' the variable in not only the base template but in
' every template that is based on it or this procedure
' will generate an error.
'
Dim sTemplateName As String
sTemplateName = ActiveDocument.Variables("BaseName").Value
' If this is not the base template for the letterhead, attach base
template
If ActiveDocument.AttachedTemplate.Name sTemplateName Then
ReplaceHeaders (sTemplateName) ' calls private sub (below)
' Application.OrganizerCopy( ' (for future work to update letterhead
styles)
AttachBase (sTemplateName)
End If
' Second part
' All new letters - show UserForm
Dim myForm As frmAddress
Set myForm = New frmAddress
myForm.Show
Unload myForm
Set myForm = Nothing
End Sub

Function WorkGroupPath() As String
' Written by Charles Kenyon
' February 28, 2003
'
' Used by templates menus to set location of templates.
' Returns workgroup tempates path with "\" at the end.
'
' This is needed because if the folder is a network drive rather
' than a folder, it will have the "\" already. If it is a folder,
' it will not have the backslash. This function gives a string
' with the backslash in either case.
'
WorkGroupPath =
Application.Options.DefaultFilePath(wdWorkgroupTem platesPath)
If Right(WorkGroupPath, 1) "\" Then
WorkGroupPath = WorkGroupPath & "\"
End If
End Function

Private Sub AttachBase(sTemplateName As String)
' Procedure written by Charles Kyle Kenyon 8 Dec 2003
' Reattaches Base Letterhead Template for form letters - attaches styles
'
Dim sTemplatesPath As String
sTemplatesPath = WorkGroupPath & "Letters & Faxes\"
'
With ActiveDocument
.UpdateStylesOnOpen = True
.AttachedTemplate = sTemplatesPath & sTemplateName
.UpdateStylesOnOpen = False
.AttachedTemplate = sTemplatesPath & sTemplateName
End With
End Sub

This procedure lets us have multiple base letterheads. (We have computers
that generate documents for more than one law firm being used by a shared
secretary.) When a change is made to the base letterhead, it will propogate
through any subsidiary letter forms.

A much simpler method would be to populate the headers and footers with
AutoText fields and simply have the AutoText in a global template that can
be updated. However, this has a disadvantage for me in that saved documents
may not have the same information as the document that was sent out. That
could be overcome as well, though, by a macro that updates and unlinks the
AutoText fields upon new document creation.

Note, the userform called in the AutoNew macro gets name and address
information about the recipient (can gather that information from other
letters written using the templates or the user can type into the userform)
and inserts the information into the letter.

I hope this gives you a start. This does not let me change complete layouts,
margins, etc., but it works, for me. If I needed to change those other
things, I could write macros that would do it. One thing it does not allow
is custom toolbars, etc. in the subsidiary templates.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"Ian" wrote in message
...
It is a headache for companies when their logo, company details, or form
format changes. They have to go through all of their templates and update
them. It would make sense for there to be a master template and sub
templates
that inherit specified elements of the master. For documents already in
place
based on a template there should be an option to accept updated template
elements.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow
this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...ocmanagemen t