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

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!

##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 Chapter and Format Chapter name. Make sure Level is 1.

If you have a TOC in your master, It is important to eliminate all Heading 1 paragraphs from appearing in the TOC. Modify paragraph style Contents 1 to give it attribute Hidden in its Font Effects tab.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer) or comment the relevant answer.

(Edit 1: removed typos which contradicted the intent)

EDIT 2020-06-03

##Attaching a paragraph to the bottom of last page

When a paragraph or group of paragraphs must be positioned to a specific location in a page, these paragraphs must be typed in a frame. The good news when several frames are to be positioned identically is there exist frame styles. Consequently, styling a frame will do the job without the need to manually set the parameters again.

For your first time, let’s do it manually. You’ll appreciate the niceties of frame styles afterwards.

Add a new last paragraph into your document. This paragraph will be empty, save for the frame anchored to it. This paragraph is only a “technical” one for the sole purpose of anchoring the frame; consequently, manage to have it out of your formatting so that it does not causes uselessly a page break unintentionally. Style it with font size 2pt (the absolute minimum), no spacing above nor below. For convenience, make it a custom style (suggested name Invisible) in your template to have it available in all your documents.

You could of course attach the frame to your last paragraph but you could forget about it and your edits could either delete it or add text after it resulting in the frame no longer being on the last page.

With the cursor in the special last paragraph, Insert>Frame. A dialog opens in its Type tab.

  • Anchor: To paragraph (default)
  • Size: set Width to the effective print width (page width - horizontal margins), you’ll tune that later if you find it is too much
  • Position Horizontal: Center in Paragraph area (uses space margin to margin)
  • Position Vertical*: Bottom to Page text area (flushes it against the bottom margin)
  • for better handling of corner cases, check Keep inside text boundaries

In Wrap tab, select Settings None so that no other text will be set on its side (important if the frame width doesn’t span from margin to margin)

You can use Spacing (mainly Above) to force some minimum padding between text and frame.

In Borders, remove the default border unless you want to emphasise this frame as not being part of main text flow.

The other tabs should be self explanatory. Enjoy.

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

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.

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.

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.

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 is all new to me.

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.

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 appear to accept fields.

I hope that explains my desire or question.

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.

Very easy, see my upcoming update.

?? Where can I find this update?

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

OMG! Works fantastically! Absolutely and exactly what I needed, absent footers flowing through correctly to the master document. Mayhaps I could replace footers with the frame so it does flow through. What you think? Hoo boy, this is good.

I could replace footers with the frame

This won’t work. Apart from the fact that positioning a frame where you want is is quite difficult when you are not versed in frame behaviour, a frame has the same inconvenient as all other data. Either it is anchored in the header/footer to be printed on every page and it does not transfer to the master. Or it is anchored in the text body and it is handed over to the master but it prints only on one page.

True. I spoke before I thought it through.

I have also tested the answer with the positioning of the frame at the top of the page, where I discovered that if the document is set to open each new H1 on a new page, it leaves the frame on a page of its own. I am wondering what will happen if I put the H1 in a frame at the top and format it to appear small, then use the H2 as my chapter title and TOC index. I shall try and report back later.

Avoid putting the Heading 1 in a frame if you expect a smoothly integrated outline structure.

Text within frames is not always scanned in the sequence you expect. The anchor points are explored in kind of insertion “date” order which is not the visual order. Therefore the Heading 1 may not occur where you expect them relative to other Heading n.

Consequently, I don’t recommend you put the fake Heading 1 in a frame for the sole purpose of sending it in an “exotic” location. It is better to format it Hidden and retrieve the associated information with a cross-reference where you want it to appear.

Ah, I see. I will experiment with that, after I get the document finished. I will finish it with the history block at the bottom of the last page, then make a copy of the document folder and play. Many thanks again, this is a solution I am happy with.