I can’t find the info for writing a string with a custom format.
I’ve tried recording a macro and using a date field but didn’t work.
my macro inserts a date but the format is DD.MM.YYYY not DD/MM/YYYY, please help me:
sub addDateText
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim sText as string
sText = Format(Now(),"dd/mm/yyyy")
dim textFormatat(0) as new com.sun.star.beans.PropertyValue
textFormatat(0).Name = "Text"
textFormatat(0).Value = sText+CHR$(9)+"[SomeText]"
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, textFormatat())
end sub