I use this macro to set the line to repeat across pages when printing a spreadsheet. But how do I remove this via macro too?
import uno
from com.sun.star.table import CellRangeAddress
#=========================================================================================
#*****************************************************************************************
def create_instance(name, with_context=False):
CTX = XSCRIPTCONTEXT.getComponentContext()
SM = CTX.ServiceManager
if with_context:
instance = SM.createInstanceWithContext(name, CTX)
else:
instance = SM.createInstance(name)
return instance
#this works ok
def add_title_row(*args):
doc = XSCRIPTCONTEXT.getDocument()
sheets = doc.Sheets
mysheet = sheets['MySheet']
title_row = CellRangeAddress()
title_row.StartRow = 0
title_row.EndRow = 0
mysheet. = title_row
return
#It does not work
def remove_title_row(*args):
doc = XSCRIPTCONTEXT.getDocument()
sheets = doc.Sheets
mysheet = sheets['MySheet']
#???
title_row = CellRangeAddress()
title_row.StartRow = None
title_row.EndRow = None
mysheet.TitleRows = title_row
return
here a simple example file:
test.ods (9,7,KB)