Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The following seems to work:

Sub SetPageMO         ' margins and orientation
  Dim oViewCursor     'Current view cursor
  Dim oStyle          'Current page style
  oViewCursor = ThisComponent.CurrentController.getViewCursor()
  ' page style name
  Dim  pageStyle as String
  pageStyle = oViewCursor.PageStyleName
  ' get page style object
  oStyle = ThisComponent.StyleFamilies.getByName("PageStyles").getByName(pageStyle)
  ' set margins 
  '   .5" = 1270 (.5 * 2540)
  oStyle.BottomMargin = 1270
  oStyle.LeftMargin = 1270
  oStyle.RightMargin = 1270
  oStyle.TopMargin = 1270
  ' set orientation
  oStyle.IsLandscape = True  
  ' swap page dimensions
  temp = oStyle.Width
  oStyle.Width = oStyle.Height
  oStyle.Height = temp
End Sub     ' End SetPageMO