S
s1004683
Hey,
I have a situation where I want to combine multiple source documents
into several target documents. When a source changes, the change has
to be visible in the target document too.
Example:
Source documents:
B1.doc
B2.doc
B3.doc
B4.doc
Target documents:
A1.doc (based on B1.doc, B2.doc)
A2.doc (based on B1.doc, B2.doc, B3.doc)
etc.
The solution
I choose "Insert> File" to add the source documents to the
targetdocuments. Now the sourcedocuments are added as fields in the
target. These fields has to be updated automaticly when the target
document is opened. I am using the following macro to do that:
http://support.microsoft.com/kb/212703
Now, this macro has to run any time when a user opens a target
document. This can be done by give the macro name "AutoExec"(http://
support.microsoft.com/kb/211659)
But there's a problem:
"The AutoExec macro runs when Word starts if the AutoExec macro was
saved as part of the default (Normal.dot) template or if it was saved
as part of a global add-in."
I cannot access the normal.dot on every computer, everything has to be
in the document itself. So AutoExec is not the solution I can use.
There is a second problem. In the top of the page is a Table of
Contents. When updating all the fields, Word is taking the following
steps:
- Empty all the fields
- Update all the fields from top to bottom, beginning with the Table
of Contents. But hey! All the fields are empty, so the Table of
Contents aren't correct
- Update the rest of the fields.
I want to update the Table of Contents on the end, also automatic. How
can I do this?
Can anyone solve me with this problems? Or is there an alternative way
to reach my goal? Thanks!
I have a situation where I want to combine multiple source documents
into several target documents. When a source changes, the change has
to be visible in the target document too.
Example:
Source documents:
B1.doc
B2.doc
B3.doc
B4.doc
Target documents:
A1.doc (based on B1.doc, B2.doc)
A2.doc (based on B1.doc, B2.doc, B3.doc)
etc.
The solution
I choose "Insert> File" to add the source documents to the
targetdocuments. Now the sourcedocuments are added as fields in the
target. These fields has to be updated automaticly when the target
document is opened. I am using the following macro to do that:
http://support.microsoft.com/kb/212703
Now, this macro has to run any time when a user opens a target
document. This can be done by give the macro name "AutoExec"(http://
support.microsoft.com/kb/211659)
But there's a problem:
"The AutoExec macro runs when Word starts if the AutoExec macro was
saved as part of the default (Normal.dot) template or if it was saved
as part of a global add-in."
I cannot access the normal.dot on every computer, everything has to be
in the document itself. So AutoExec is not the solution I can use.
There is a second problem. In the top of the page is a Table of
Contents. When updating all the fields, Word is taking the following
steps:
- Empty all the fields
- Update all the fields from top to bottom, beginning with the Table
of Contents. But hey! All the fields are empty, so the Table of
Contents aren't correct
- Update the rest of the fields.
I want to update the Table of Contents on the end, also automatic. How
can I do this?
Can anyone solve me with this problems? Or is there an alternative way
to reach my goal? Thanks!