Updating Documents Created From a Master Document Template 
Author Message
 Updating Documents Created From a Master Document Template

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      



Mon, 13 Sep 2004 08:55:11 GMT  
 Updating Documents Created From a Master Document Template
Hi Simon,

Are you familiar with the {DOCPROPERTY} field? Or are you saying that the
{DOCPROPERTY} filed doesn't meet your needs?

HTH

Quote:
> 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



Mon, 13 Sep 2004 21:05:45 GMT  
 Updating Documents Created From a Master Document Template
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
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
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

Quote:
> 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



Mon, 13 Sep 2004 21:33:01 GMT  
 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

- Show quoted text -

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

>.



Sat, 18 Sep 2004 05:46:12 GMT  
 Updating Documents Created From a Master Document Template
Hi Simon,

You're right, the auto macros will not work as you want the routine to work.
However, they are the closest to updating the fields as I think you will get
because of your preference that "I would like to be able to do this without
having to open up each individual document."

HTH

Quote:
> 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
> >-----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
> >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
> >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

> >.



Sat, 18 Sep 2004 21:18:17 GMT  
 Updating Documents Created From a Master Document Template
Thanks Dave for your help!  Now I can make a decision as
to what I'm going to do with my template.  Knowing that I
have made an exhaustive search into figuring out whether
this can be done definitely helps.  It would have been
nice if there was a way, but thanks for confirming that it
cannot be done.  Yes, I did want the documents to be
updated without having to open them.  In any case, I will
have to go about this in some other way.  

Simon  

Quote:
>-----Original Message-----
>Hi Simon,

>You're right, the auto macros will not work as you want

the routine to work.
Quote:
>However, they are the closest to updating the fields as I
think you will get
>because of your preference that "I would like to be able
to do this without
>having to open up each individual document."

>HTH


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



Sun, 19 Sep 2004 00:58:32 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How to update document master shapes from template master shapes

2. Copy a document but without the document template

3. Form is updating template, not new document

4. Updated Document Properties in protected template

5. Creating Word documents from an Embedded OLE Word Template

6. Programatically creating a Word document based on a template

7. Removing a reference to word template from its create document

8. Winword 2K crashes creating document from template

9. Switching to new document created from template (in VBA)

10. Creating a new document using a template

11. Problem creating a document from a template in a web-folder

12. Creating new document based on template using commandbutton on userform

 

 
Powered by phpBB® Forum Software