I am trying to write an OOo Basic macro enabling the automatic resize of the Math formulas embedded as objects in a Writer document. The behavior I would like to implement is:
1. if there is no selection, then operate on the whole document;
2. else operate only on the objects in the selection.
The logic to solve the problem 1 is:
Code: Select all
for i = 0 to ThisComponent.getEmbeddedObjects().count - 1
obj = objs(i).getEmbeddedObject()
if (not IsNull(obj)) and obj.supportsService("com.sun.star.formula.FormulaProperties") then
obj.BaseFontHeight = newFontSize ' set somehow
end if
next i
Code: Select all
objs_in_sel = doc.getCurrentSelection().getByIndex(0).getEmbeddedObjects()
I would really appreciate an help.
Luca