Embed today() function in a Writer doc
Embed today() function in a Writer doc
I want to have the current date in a writer document, so that whenever I open the document, it will always have today's date. I'm trying to create a letter template, and need the current date when I create a new letter from the template.
Open Office version: AOO415m1(Build:9789) - Rev. 1817496 2017-12-11 17:25
Windows 10 operating system
Windows 10 operating system
Re: embed today() function in a writer doc
Use the menu Insert -> Fields -> Date to place a date in the document. Then right click on that date and select Fields. In the Select area of the dialog, change it from Date (fixed) to Date
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: embed today() function in a writer doc
Be aware that if you use Date, and create a letter on 20 April 2018 using the template, and then open the letter .odt file on 3 May, the letter will show 3 May which is not the date the letter was written.lennyg wrote:I want to have the current date in a writer document, so that whenever I open the document, it will always have today's date. I'm trying to create a letter template, and need the current date when I create a new letter from the template.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Re: Embed today() function in a Writer doc
If you use the menu item Insert - Fields - Date, it will insert the Date (fixed) field. Normally, this is what you would want for a document date. The date when a letter was written is relevant, but the (later) date when you reopen it is usually not.
In your template the Date (fixed) field will not change, but always show as the date when the template was created. When you use the template to create a new letter, the field will display the creation date for that new letter.
Note: For this to work, you must save your template with the template filetype. If you (like most people I know) save your templates as standard documents, this will not work.
To edit properly saved templates, you need to right click them in an Explorer window and select Open. Double click in Explorer or Open from Writer will create a new document based on the template, so "save" will not be automatically redirected to your template.
If you change the field type from Date (fixed) to Date, it will always show current date. This makes sense for logs and other "live" documents, where printouts should display the current date. This complies verbatim with your request that "... whenever I open the document, it will always have today's date". For a letter template, this makes no sense to me, and I suspect that it is not what you meant.
You see the full selection of available fields if you go to Insert - Fields - Other ... In addition to the date fields in the Document category, you also find a few options if you select the DocInformation tab. The Created - Date from DocInformation seems to work exactly like the Date (fixed) in the Document category. Other dates can be inserted from the Last Printed and Modified groups.
In your template the Date (fixed) field will not change, but always show as the date when the template was created. When you use the template to create a new letter, the field will display the creation date for that new letter.
Note: For this to work, you must save your template with the template filetype. If you (like most people I know) save your templates as standard documents, this will not work.
To edit properly saved templates, you need to right click them in an Explorer window and select Open. Double click in Explorer or Open from Writer will create a new document based on the template, so "save" will not be automatically redirected to your template.
If you change the field type from Date (fixed) to Date, it will always show current date. This makes sense for logs and other "live" documents, where printouts should display the current date. This complies verbatim with your request that "... whenever I open the document, it will always have today's date". For a letter template, this makes no sense to me, and I suspect that it is not what you meant.
You see the full selection of available fields if you go to Insert - Fields - Other ... In addition to the date fields in the Document category, you also find a few options if you select the DocInformation tab. The Created - Date from DocInformation seems to work exactly like the Date (fixed) in the Document category. Other dates can be inserted from the Last Printed and Modified groups.