Open Office OLE change page orientation lazarus / 21-General ---------------------------------------------------------------------- onkeltorty · 2023-11-22 03:59 Hello, I'm looking for a way to change the orientation of the page from portrait to landscape in Open Office Writer with OLE. I tried to change it with UNO, but it only seems to be possible to call the dialog for the page format ('.uno:PageDialog'). Does anyone here know how to program this with Lazarus? I've gotten this far so far: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TOleInterf.SetPageOrientation(bLandscape: boolean = false);var  vStyleFamilies, vPageStyles, vStandard, vNewStyle: variant;begin  vStyleFamilies := rDocs.vDocs[rDocs.byteActualDocument-1].StyleFamilies;  vPageStyles := vStyleFamilies.getByName('PageStyles');   If vPageStyles.hasByName('MyPageStyle1') Then vPageStyles.removeByName('MyPageStyle1');   vNewStyle := rDocs.vDocs[r Docs.byteActualDocument- 1].createInstance('com.sun.star.style.PageStyle');  vNewStyle.Size.Width := 29700;  //DIN A4 Höhe  vNewStyle.Size.Height := 21000; //DIN A4 Breite  vNewStyle.isLandscape := bLandscape;  vPageStyles.insertByName('MyPageStyle1', vNewStyle);   //rDocs.vDocs[rDocs.byteActualDocument-1].PageStyle.isLandscape := true; //Exception   vStandard:= vPageStyles.getByName('Standard');  vStandard.isLandscape := bLandscape;  //rDocs.vDocs[rDocs.byteActualDocument-1].PageStyle := vStandard; //Exceptionend;If you execute this code, Open Office shows under "Format" -> "Page" that the page is in landscape format, but the page itself is in portrait format. Does anyone have a solution for this?