
Updating Documents Created From a Master Document Template
Dave,
Thanks for the suggestions. However, I am not so sure
that the macros you provided are going to do what I want.
Let me try to be more specific. I have created a master
template. I will create multiple project documents from
this template. If I make a change to any one of the
document property fields in the master template, I want it
to update all the fields across every document created
from that template. It should update as soon as I
click "OK."
So, it's kinda like having a batch of documents in one
folder. If I change the company name field to "Space
Communications" in the master template, then all the
company name fields in each associated document should be
updated with the new name. Can this be done?
The macro or code would probably have to be contained
within the "Private Sub btnOK_Click()" command. Please
let me know if you have any ideas. Thanks again Dave!
Simon
Quote:
>-----Original Message-----
>Hi Simon,
>D'oh. I guess that goes to show you: don't respond to a
question until
>you've finished your first cup of inspiration (i.e.,
coffee). I see that
Quote:
>you have tried using the {DOCPROPERTY} field (but in your
template).
>Would automacros like the following solve your problem?
>'-----------------------
>Public Sub AutoExec()
>Call TestCustomDocProperty
>End Sub
>'-----------------------
>'-----------------------
>Public Sub AutoNew()
>Call AddCustomDocProperty
>End Sub
>'-----------------------
>'-----------------------
>Public Sub AutoOpen()
>Call TestCustomDocProperty
>End Sub
>'-----------------------
>'-----------------------
>Public Sub TestCustomDocProperty()
>If ActiveDocument.CustomDocumentProperties("Testing")
<> "" Then
> ActiveDocument.CustomDocumentProperties
("Testing").Value = 47
Quote:
>Else
> Call AddCustomDocProperty
>End If
>Call UpdateAllFields
>End Sub
>'-----------------------
>'-----------------------
>Public Sub AddCustomDocProperty()
> ActiveDocument.CustomDocumentProperties.Add _
> Name:="Testing", LinkToContent:=False, Value:=47,
_
> Type:=msoPropertyTypeNumber
> ' now the field is available to be inserted
>End Sub
>'-----------------------
>'-----------------------
>Public Sub UpdateAllFields()
>Dim myStoryRange As Range
> For Each myStoryRange In ActiveDocument.StoryRanges
> myStoryRange.Fields.Update
> Next myStoryRange
>End Sub
>'-----------------------
>HTH
>> Hi Simon,
>> Are you familiar with the {DOCPROPERTY} field? Or are
you saying that the
>> {DOCPROPERTY} filed doesn't meet your needs?
>> HTH
>> > Hi All:
>> > I have created a master document template (*.dot
file) in
>> > Word 2000 with "document property" fields. I have
also
>> > created macros within the template that bring up a vb
form
>> > to edit the text in the fields. These fields will
hold
>> > common information across multiple documents.
>> > I want to be able to create documents (*.doc files)
off of
>> > the master template, and then update the "document
>> > property" fields with whatever information is
contained in
>> > the same fields of the master document template. So,
if I
>> > make any changes in the template, I want to know how
I can
>> > replicate those changes to the documents created from
that
>> > template. I would like to be able to do this without
>> > having to open up each individual document. There
should
>> > be some macro or code that automatically updates the
>> > documents after I make any changes to those fields in
the
>> > master template.
>> > Any help or suggestions would be appreciated. Thanks
>> > again.
>> > Simon
>.