Code: Alles auswählen
sub Main
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:InsertFootnote", "", 0, Array())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Text"
args2(0).Value = ""
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args2())
dispatcher.executeDispatch(document, ".uno:JumpToFootnoteOrAnchor", "", 0, Array())
dim args3(1) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Count"
args3(0).Value = 1
args3(1).Name = "Select"
args3(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args3())
rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "Text"
args4(0).Value = ")"
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args4())
args3(0).Value = 1
args3(1).Value = true
dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, args3())
dim args5(1) as new com.sun.star.beans.PropertyValue
args5(0).Name = "Template"
args5(0).Value = "Fußnotenanker"
args5(1).Name = "Family"
args5(1).Value = 1
dispatcher.executeDispatch(document, ".uno:StyleApply", "", 0, args5())
args3(0).Value = 1
args3(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, args3())
dispatcher.executeDispatch(document, ".uno:JumpToFootnoteOrAnchor", "", 0, Array())
end sub
Dieses Makro fügt beim Starten immer eine neue Fußnote mit ) hinter dem Anker hinzu.
Gruß
Stephan