Search code examples
oracleoracle10goleoracleforms

Oracle forms 10g WebUtil CLIENT_OLE2.set_property LANDSCAPE problem


I'm having problems setting the page orientation of the output word document. I'm using the below code but it's coming up with an error, (unable to set page orientation to LANDSCAPE) if I comment out the page_orientation code (below) the word document is created, data is written to the document, everything works fine except obviously not in the LANDSCAPE orientation that is needed. Why isn't page_orientation working? Is there a work around?

PROCEDURE set_page_orientation( p_orientation IN VARCHAR2 )
DECLARE
  PageSetup                CLIENT_OLE2.OBJ_TYPE;
  c_wdOrientPortrait       CONSTANT NUMBER DEFAULT 0;
  c_wdOrientLandscape      CONSTANT NUMBER DEFAULT 1;
BEGIN

    PageSetup := CLIENT_OLE2.GET_OBJ_PROPERTY( Selection, 'PageSetup' );
    IF p_orientation = 'LANDSCAPE' THEN
      CLIENT_OLE2.SET_PROPERTY( PageSetup, 'Orientation', c_wdOrientLandscape );
    ELSE
      CLIENT_OLE2.SET_PROPERTY( PageSetup, 'Orientation', c_wdOrientPortrait );
    END IF;
END;

thanks in advance.


Solution

  • Unless I'm wrong,

    • 1 is portrait (you set it to 0)
    • 2 is landscape (you set it to 1)