siehe Anlage.
Code: Alles auswählen
sub formel_einfuegen
oSelection = thisComponent.CurrentSelection
if not oSelection.supportsService("com.sun.star.text.TextRanges") then exit sub
sFormel = inputbox("Formel eingeben", "Formel eingeben", "nroot a b cdot int (s over t)")
sName = "com.sun.star.text.TextEmbeddedObject"
obj = ThisComponent.createInstance(sName)
obj.CLSID = "078B7ABA-54FC-457F-8551-6147e776a997"
obj.attach(oSelection.getByIndex(0))
oFormula = obj.EmbeddedObject
oFormula.Formula = sFormel
end sub
Axel