[Solved] Using MathType via LibreOffice
Posted: Wed Nov 15, 2017 12:42 am
Hi, I'm trying to make a macro that allow me to work with MathType. Actually, I succeeded to do so but have one little problem:
The equation dose not align properly, and i need manually fixing it every time via right-click -> properties (I uploaded photos that point out the specific properties I need to change). Here the code:
the question is: how do I change these properties using the code?
thanks for your help (and sorry for my bad English)
The equation dose not align properly, and i need manually fixing it every time via right-click -> properties (I uploaded photos that point out the specific properties I need to change). Here the code:
Code: Select all
sub InsertMathTypeObject
dim oTargetDocument as variant
oTargetDocument = ThisComponent
dim oCurrentController as variant
oCurrentController = oTargetDocument.getCurrentController()
dim oFormula as variant
oFormula = oTargetDocument.createInstance("com.sun.star.text.TextEmbeddedObject")
oFormula.CLSID = "0002CE03-0000-0000-C000-000000000046"
oFormula.AnchorType = com.sun.star.text.TextContentAnchorType.AS_CHARACTER
oFormula.attach(oCurrentController.Selection.getByIndex(0) )
dim oXCOEO as variant: oXCOEO = oFormula.ExtendedControlOverEmbeddedObject
oXCOEO.doVerb(com.sun.star.embed.EmbedVerbs.MS_OLEVERB_PRIMARY)
end sub
thanks for your help (and sorry for my bad English)