There is a similar question here but using calc however teh answer woul seem to be calc specific. I would like to write a macro in libre writer that inserts the current date, a comma and space then the current date + 2 days, a comma and space then the current date + 14 days.
Recording a marco of date insertion gives the following however to be honest i dont have a clue how to interpret this code and can find little help on the net.
sub recall_period
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertDateField", "", 0, Array())
end sub
Would appreciate any helps or ides. Cheers Damian
Andrew Pitonyak's macro document has a number of examples of working with dates.
Note: Recording a macro is usually not a good way to learn Basic programming, because it records ugly dispatcher calls rather than more elegant API code.