Message de Andrew Douglas Pitonyak date 2009-02-03 16:50 :
How can I find a Formula object in a paragraph?
I used a simple enumeration of the text object, and I even found the
text section containing the formula. I only know this, however, because
I used a very simple document with simple text and a formula (or two).
The enumeration starts as follows:
oParEnum = oDoc.getText().createEnumeration()
Do While oParEnum.hasMoreElements()
oPar = oParEnum.nextElement()
If oPar.supportsService("com.sun.star.text.Paragraph") Then
oEnum = oPar.createEnumeration()
Do While oEnum.hasMoreElements()
oSect = oEnum.nextElement()
I found the formulas with yet another enumeration:
if oSect.supportsService("com.sun.star.text.TextPortion") Then
if oSect.TextPortionType = "Frame" then
oTcEnu =
oSect.createContentEnumeration("com.sun.star.formula.FormulaProperties")
Do While oTcEnu.hasMoreElements()
oTc = oTcEnu.nextElement()
oTc is the embedded formula object.
Regards
Bernard
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]