By a question in a different forum Iwas pointed to the fact that TextFields, in specific DateTime fields addressed there, are not found by a search if matching the 'Search for' string.
I took the oportunity to consider this, and tend to judge that behaviour to be a "heritage bug". A textcursor spanning the range of the field is knowing the string well. It should not be to difficult to include it when searching.
Anyway some person writing a diary or minuting a discussions may want to insert dates or times as fields using a shortcut. The person may then want to be able to search for some of the inserted fields. Difficult thing?
It gets rather simple if the person decides to definitely convert the DateTime (date or time) fields to ordinary text portions. How to do so for a complete text document in Writer, including any substructures (frames, tables, nested specimen of these kinds; shapes don't accept TextFields) by a few lines of code is demonstrated in the attached example.
If there is an additional need to harmonize the formats (two classes for dates and times e.g.) or to convert Time fields to DateTime fields in advance of conversion, please report your case. I'm not the most important user of this tool. As it is presented here, the number formats and the text formats as well are preserved.
Convert DateTime fields to ordinary text portions
Forum rules
For sharing working examples of macros / scripts. These can be in any script language supported by OpenOffice.org [Basic, Python, Netbean] or as source code files in Java or C# even - but requires the actual source code listing. This section is not for asking questions about writing your own macros.
For sharing working examples of macros / scripts. These can be in any script language supported by OpenOffice.org [Basic, Python, Netbean] or as source code files in Java or C# even - but requires the actual source code listing. This section is not for asking questions about writing your own macros.
Convert DateTime fields to ordinary text portions
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Convert DateTime fields to ordinary text portions
The Edit Fields dialog box isn't very good. Perhaps not difficult though to make an alternative one that lists all the date fields at once.
A custom character style could be used for dates.
A custom character style could be used for dates.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)