[Solved] How to Change Date Format by Editing a Macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
GridLok
Posts: 109
Joined: Thu Mar 08, 2012 12:54 pm
Location: Adelaide, South Australia

[Solved] How to Change Date Format by Editing a Macro

Post by GridLok »

I have only a very rudimentary knowledge of how to create and use Macros - I use the Macro Recorder rather than 'write' my own. It is a tribute to OO Writer's usability that I have successfully created macros for Date and Time, AND associated keyboard shortcuts with them. However, I want to change the format of one of my two Date macros. Rather than delete the macro that produced a Date format I no longer want to use, then workout how to associate the chosen keyboard shortcut with a newly recorded macro, I thought I might be able to simply edit the existing macro. When I examined the code in the editing panel, it was evident that there was an Argument named "Format" followed by a Value comprising four digits (in this case 8083). In a macro that also produces a Date output - but in my now preferred format, the 'Format Value' is 8037. This led me to think that there might be a list of similar numbers, each corresponding to a particular date format and, if I could find it, I ought to be able to achieve my desired outcome by inserting the appropriate number. But, I can't find such a list.

The Date format I wish to use results in dd/mm/yy. I would like to have the option of yy/mm/dd.
Last edited by GridLok on Tue Aug 07, 2018 7:03 am, edited 1 time in total.
"To find the right answer, first find the right question"
OpenOffice org. 4.1.4
OO414m5(Build:9788) - Rev. 1811857
2017-10-16 22:12:14 (Mon, 16 Oct 2017) - Darwin x86_64
Mac OS X 10.12.6 (Sierra)
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to Change Date Format by Editing a Macro

Post by Villeroy »

Nobody needs a macro to insert a formatted date field into a Writer document. An auto-text entry will do.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
GridLok
Posts: 109
Joined: Thu Mar 08, 2012 12:54 pm
Location: Adelaide, South Australia

Re: How to Change Date Format by Editing a Macro

Post by GridLok »

Thank you Villeroy. My Maths teacher once said that, if there was a difficult or long way to achieve a solution, I would find it. I guess I did at least learn a little about macros and their implementation. I think I will change my 'signature' to read … "To find the right answer, first find the right question". Not original, I know, but something of which I need to be constantly reminded!
"To find the right answer, first find the right question"
OpenOffice org. 4.1.4
OO414m5(Build:9788) - Rev. 1811857
2017-10-16 22:12:14 (Mon, 16 Oct 2017) - Darwin x86_64
Mac OS X 10.12.6 (Sierra)
Post Reply