sub Main dim document as object dim dispatcher as object rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(1) as new com.sun.star.beans.PropertyValue nowtime=now() args1(0).Name = "Name" args1(0).Value = format(hour(nowtime),"00") & _ format(minute(nowtime),"00") & _ format(second(nowtime),"00") args1(1).Name = "Index" args1(1).Value = 1
dispatcher.executeDispatch(document, ".uno:Insert", "", 0, args1()) end sub