Cristian Fonti wrote:

Hi to all,
what is the property in Java Api to set the Page size(A4,A3...) and the Page Format (Landscape,Portrait)/Allignment in a Writer Document??? I use this code:
XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument);
XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
XNameAccess PageStyles = (XNameAccess)
UnoRuntime.queryInterface(XNameAccess.class,StyleFamNames.getByName("PageStyles"));


XStyle xStyle = (XStyle) UnoRuntime.queryInterface(XStyle.class,PageStyles.getByName("Standard"));
XPropertySet xPropertySetStyle = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xStyle);


i try to use: xPropertySetStyle.setPropertyValue("PrinterPaperTray",com.sun.star.view.PaperOrientation.LANDSCAPE);

but nothing...
Please someone help me.
Thanks
Cristian

I think that you must set the mode in the page style. You are setting the paper tray that should be used, but I expected you to set the IsLandscape property....


Sub TestLandScape
 Dim oCurs
 Dim oPStyle
 Dim oPStyles

oCurs = ThisComponent.getCurrentController().getViewCursor() oPStyles = ThisComponent.getStyleFamilies().getByName("PageStyles")
oPStyle = oPStyles.getByName(oCurs.PageStyleName)
Print "State of landscape = " & oPStyle.IsLandscape
End Sub


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info:  http://www.pitonyak.org/oo.php


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to