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 Create User defined Property

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
ramlogu
General User
General User


Joined: 13 Aug 2007
Posts: 34

PostPosted: Wed Sep 12, 2007 9:57 pm    Post subject: How to Create User defined Property Reply with quote

Hi

I want to create my own property and property value and set in to XTextFrame's propertyset. I think it is possible to create our own property. Help plz to create the same

Ram
Back to top
View user's profile Send private message
ramlogu
General User
General User


Joined: 13 Aug 2007
Posts: 34

PostPosted: Thu Sep 13, 2007 6:40 am    Post subject: Reply with quote

Hi

I have implemented this using the following code,But after save and reopen the document i can't get my value

Code:

        XPropertySet propertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextSection);
        XNameContainer container = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class,
                propertySet.getPropertyValue("UserDefinedAttributes"));
        AttributeData a = new AttributeData();
        a.Type = "CDATA";
        a.Value = "MyDatavalue";
        container.insertByName("MyDataName", a);
        propertySet.setPropertyValue("UserDefinedAttributes", container)


Code for get the value
Code:

        XPropertySet propertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextSection);
        XNameContainer container = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class,  propertySet.getPropertyValue("UserDefinedAttributes"));
        AttributeData a = (AttributeData).getByName("MyDataName");
        String myval =  a.Value;
           


How can i set my value permanently. is it possible?, otherwise there is any alternative ?

Ram
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 Macros and API 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