1

I keep searching without any results so i would give it a try here. I'm trying to make a document for OpenOffice with Python.. I just can't find how to set the top margin of the document. Anybody has an idea how to do this?

thanks in advance!

Rafał Dowgird
  • 43,216
  • 11
  • 77
  • 90
ProCx
  • 199
  • 5
  • 18

1 Answers1

1

Something like this seems to work for me (in a Python macro context):

import uno

def setMargin():
    doc = XSCRIPTCONTEXT.getDocument()
    oStyle = doc.StyleFamilies.getByName("PageStyles").getByName("Default")
    oStyle.TopMargin = 5000  #Not sure what the units are
Rafał Dowgird
  • 43,216
  • 11
  • 77
  • 90