
Document variable with value that changes throughout the document
While looking into this for you I tried to add a DocVariable to the
header called SectionName then to set that at various points in the
document. I gave up when I saw a reference to Mail Merge in
the help file. I think that you could use this in your document
by inserting fields into the document and then having the values
to those fields in a file. Your mail merge will only have one
record with many fields. If this did not give you all you needed
then you could (possible) add the rest with some
VBA - maybe
to set up the mail mere file with the values taken from the
document. They could be from the style used or a bookmark
used - maybe a heading style or a hidden text style.
It is just an idea that may help.
Chrissy.
Chad Clancy wrote
Quote:
> I have a document in which I would like to use some sort of document
> variable whose value changes throughout the document. The variable is
> to be set to a section title and this section title will vary
> depending on the location within the document. Its value will be set
> by some sort of initialization statement.
> The value of the variable will be referenced throughout the document
> but this value varies depending on where the reference appears in the
> document.
> I tried to accomplish this by defining a bookmark and assigning it a
> value. If I have multiple SET fields to initialize the bookmark, the
> REF fields always result in the most recent initialization of the
> bookmark, even if the REF appears before the new initialization.
> Is this possible? If so, what is the best way to accomplish such a
> task.