OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How to read styles of paragraph in java?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
MorganSteve82
Newbie
Newbie


Joined: 29 Jul 2005
Posts: 2

PostPosted: Fri Jul 29, 2005 2:10 am    Post subject: How to read styles of paragraph in java? Reply with quote

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:-)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group