We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

[Writer] Setting Subdocument Creation and Modification Dates Into a Master Document footer

asked 2020-06-02 18:29:55 +0200

Kirk Ward gravatar image

updated 2020-07-29 00:07:11 +0200

Alex Kemp gravatar image

I would like to insert the creation and last modification dates into a subdocument so that it appears either at the end of the subdocument (a chapter or section), possibly even in the footer.

First of all, how do I retrieve the creation date automatically and have it inserted into the subdocument?

Second how do I retrieve the last modification date automatically and have it also inserted into the subdocument?

Third, is it possible to insert these fields into the footer of the master document in each chapter or section?

Thanks in advance! Kirk

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-06-02 19:35:17 +0200

ajlittoz gravatar image

updated 2020-06-03 18:05:09 +0200

Creation date

Insert a field where you want it to appear with Insert>Field>More Fields, DocInformation tab. The Type is Created and you can Select Date and Time which can be Formatted in various ways.

Modification date

This is quite similar, Type is now Modified

There is no difference whether you are in the master or subdocument. These fields retrieve the information for the current document.

Transferring date stamps to the master document

Important notice: header and footer content of a subdocument is not transferred to the master because the master uses its own page styles (even if page styles have the same name, the effective occurrence is not the same). Consequently you must regenerate the information in the master.

First thought workaround

Since you can't get anything from a subdocument header/footer, the information must be inserted somewhere in the body of text. I suggest a paragraph at the beginning of each chapter with a dedicated paragraph style to make Hidden (configure your view options so that the paragraph remains displayed on screen, with "decorators" warning you it is hidden and not printing. This will facilitate document maintenance.)

In the subdocument, insert the date and time fields in this special paragraph. Select it. Insert>Bookmark to give a unique name to the selection.

In the master, where you want the subdocument timestamp to appear, Insert>Cross-reference, Cross-references tab, Type Bookmarks, select the required one and Insert reference to Reference to retrieve the bookmark content.

This "naive" workaround has a very big inconvenient.

Usually, you try to use a single page style for all your chapters, inserting variable content like chapter heading, with fields. Here, due to the requirement that a bookmark must be unique to uniquely identify a subdocument, the single chapter page style is defeated.

Second thought solution

To be able to automate the header and footer in the master chapters, we must be able to use the same cross-reference for all subdocuments.

The only "dynamic" fields I know of are those related to chapter numbering. I then suggest to install a stowaway in the chapter machinery and trick Writer.

Since this indirect field reference must be present in any circumstance, the information has to be in Heading 1 paragraphs. This means you have to "offset" your chapter numbering: chapter titles are at level 2 instead of 1, sub-chapters at level 3 instead of 2, etc. Very easy: you just change the paragraph style.

Don't forget to customise Tools>Chapter Numbering to also "offset" the numbering, i.e. to ignore level 1.

Of course, formatting must also be offset one level: modify the Heading n paragraph style to move down one level the typographic attributes. Make Heading 1 Hidden.

Note: this tweaking on Heading n styles need to be done only in the master since you won't print the subdocuments (at least for release).

To retrieve the timestamp, Insert>Field>More Fields, Document tab. Type is ... (more)

edit flag offensive delete link more


Wow, a lot to absorb. I shall have to practice abit to see what the rresults are, and report back here. Thank you.

Kirk Ward gravatar imageKirk Ward ( 2020-06-02 19:52:26 +0200 )edit

I feel however that there are still unexpected "glitches" with my second solution. I investigate to see if there is a simpler way of doing it.

ajlittoz gravatar imageajlittoz ( 2020-06-02 20:05:19 +0200 )edit

Ideally, the less intrusive method would request the value of a variable: a variable can be set and reset at will. Therefore a field captures the last known value of the variable. The same variable can be used in many subdocuments and the master will show the current value for the page where the insertion occurs. Good!

But variables and DocInformation live in totally separate spaces with impenetrable barriers. The date stamps cannot be stored in variables. Shame because it would have be simple and smart.

ajlittoz gravatar imageajlittoz ( 2020-06-02 20:27:07 +0200 )edit

I have gotten lost in the answer and will have to spend more time working and absorbing. Meanwhile, I had previously tried inserting the date modified field into the body of the subdocument text. It appeared on the edited subdocument page when the master was opened, but as it is the same date as the modified, I will have to wait until tomorrow at least to see if it carries through. Unless I change my system date. I may try that.

Kirk Ward gravatar imageKirk Ward ( 2020-06-02 21:56:41 +0200 )edit

I changed the system date, and the modified date of the subdocument stayed the same in the master document. So now, when a section in the operations manual is updated, the user will be able to easily tell if the new chapter is the most current chapter.

Would be nice if I could place the information in a text box or something and have it anchored to the bottom of the last page. However, I have been unable to find an object that allows fields that will flow through to the master document. Also, my fields for title and date created cannot be used in a field. Empty fields are returned.

As an FYI, I only converted from AOo just over a month or so ago. I used it for over fifteen years or more, starting with the original StarWriter way back "in the day." So, the power of LO ...(plus)

Kirk Ward gravatar imageKirk Ward ( 2020-06-02 22:09:36 +0200 )edit

Would be nice if I could place the information in a text box or something and have it anchored to the bottom of the last page

Define exactly what you want and I'll update my answer. Text Boxes are definitely not the way to go.

an object that allows fields that will flow through to the master document

What do you mean? A paragraph seems to be the common object for that.

have it anchored to the bottom of the last page

The simplest is to insert it in the footer. It will then appear on every page. If you want it only on the last page, insert it in the last paragraph of the chapter. But if you want it only in the footer of the last page, the trick is more complicated. Just tell your requirement and I'll explain.

ajlittoz gravatar imageajlittoz ( 2020-06-03 09:53:31 +0200 )edit

I am preparing a business operating manual, which requires lsubdocuments for each operational unit. Since a change may occur in a subdocument, that does not affect any other unit, then the subdocument is the only one that will be modified. However, since these will be printed documents, distributed to a group of similar stores, we want each individual owner to see the most current modification date on the actual paper when we refer to it.

Therefore, I would like the subdocument title, creation date and last modified date to appear in or very near the bottom of the last page. While I can create a paragraph and push it down with carriage returns, my preferred method is to have the data pinned to the bottom of the text area of the last page, much as an image can be. I have tried shapes and text boxes, but they do not ...(plus)

Kirk Ward gravatar imageKirk Ward ( 2020-06-03 14:36:12 +0200 )edit

Very easy, see my upcoming update.

General caveat: stay away of text boxes or shapes unless you use them as small pictures or icons. They are graphical objects and can only be labelled (the small text u=you attach to them). They are outside text flow and lack totally the usual formatting facilities.

ajlittoz gravatar imageajlittoz ( 2020-06-03 17:39:29 +0200 )edit

Very easy, see my upcoming update.

?? Where can I find this update?

Kirk Ward gravatar imageKirk Ward ( 2020-06-03 17:59:09 +0200 )edit

I wrote this comment before the update to notify I was working on it. It should now be visible.

ajlittoz gravatar imageajlittoz ( 2020-06-03 18:06:38 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-06-02 18:29:55 +0200

Seen: 141 times

Last updated: Jun 03 '20