Hello m kechinov,
Михаил Кечинов wrote (7-2-2009 22:09)
Hello again. I trying to change height, width and margins of opened
document.
I have this code, but in's not working:
================ cut ==================
...
// it works
xComponentLoader =
(com.sun.star.frame.XComponentLoader)UnoRuntime.queryInterface(com.sun.star.frame.XComponentLoader.class,
xDesktop);
xComponent = xComponentLoader.loadComponentFromURL(sourceFile, "_blank", 0,
openProperties);
com.sun.star.beans.XPropertySet xPageProperties =
(com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xComponent );
try {
xPageProperties.setPropertyValue("Height", new Integer(pageHeight));
...
It dies with message:
"setPropertyValue(Unknown Source)";
The properties you try to set, belong to the page style.
So you have to get the stylefamilies from the document. And from there
the pagestyles, and then the according properties, I guess in your case
from the style Default.
HTH & regards,
Cor
--
Cor Nouws - nl.OpenOffice.org marketing contact
= "2008: The Year of 3" = www.nieuwsteoffice.nl =
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]