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 make XTextSection invisible using java code

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


Joined: 21 Jul 2009
Posts: 4

PostPosted: Wed Jul 22, 2009 5:53 am    Post subject: How to make XTextSection invisible using java code Reply with quote

I am generating a doc from .odt template using open office java api. I have few text sections in my .ODT template and while generating doc I need to make some of the text sections invisible based on some condition. Below is the code that I am using..but seems its not working. After generating a doc those sections whose property I set to invisible are still showing up.
Code:

XTextSectionsSupplier sectionsSupplier = (XTextSectionsSupplier)UnoRuntime.queryInterface(XTextSectionsSupplier.class, component);
XNameAccess sectionNamedAccess = sectionsSupplier.getTextSections();
XTextSection textSection = (XTextSection)UnoRuntime.queryInterface(XTextSection.class, sectionNamedAccess.getByName("SectionFour"));
XPropertySet textSectionProperty = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, textSection);
textSectionProperty.setPropertyValue("IsVisible", new Boolean(false));


Could anybody please suggest whats going wrong in here?

Nitin
Back to top
View user's profile Send private message
nitink
Newbie
Newbie


Joined: 21 Jul 2009
Posts: 4

PostPosted: Wed Jul 29, 2009 7:22 am    Post subject: How to remove TextSection from a document Reply with quote

Is there any way by which I can remove or delete text sections from a document? I have been trying to make unwanted sections invisible but no luck. Also some threads suggests to delete text within those sections but doing this leaves an empty space.

kindly suggest.

NK
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