MorganSteve82 Newbie

Joined: 29 Jul 2005 Posts: 2
|
Posted: Fri Jul 29, 2005 2:10 am Post subject: How to read styles of paragraph in java? |
|
|
I have to read styles of paragraph of a document opened with openOffice.
i tried in this way:
// While there are paragraphs, do things to them
XParagraphCursor xParaCursor = (XParagraphCursor)UnoRuntime.queryInterface(
XParagraphCursor.class, mxDocCursor);
xParaCursor.gotoStartOfParagraph(true);
while (xParaEnum.hasMoreElements()) {
xParaCursor.gotoNextParagraph(true);
XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, mxDocCursor);
Object o=xCursorProps.getPropertyValue("ParaStyleName");
System.out.println(o.toString());
if(!xParaCursor.gotoNextParagraph(false)){
xParaCursor.gotoEndOfParagraph(true);
}
else xParaCursor.gotoPreviousParagraph(false);
xParaEnum.nextElement();
i++;
}
i need to read the text of the paragraph and the style of the paragraph. In this way i can't read correctly the style! If someone can help me..thanks:-) |
|