ramlogu General User

Joined: 13 Aug 2007 Posts: 34
|
Posted: Thu Sep 13, 2007 6:40 am Post subject: |
|
|
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 |
|