[Solved] Enable print headers in Calc
Posted: Tue Jul 11, 2017 2:25 pm
Hi.
I am trying to enable printing of row and column headers in Calc (OpenOffice 4.1.3, win10) with a macro, that runs when printing.
The macro I have written does not throw any errors, and when I ask it to output the value of the printHeaders option, the output is correct.
However the printout does not have the headers and when looking in Format > Page... > Print, printing of headers is not on.
This is my macro as of now;
Does the macro need to refresh the document before it is updated? Or is it something else like that?
Any help will be greatly appreciated.
Note: The reason why I want to use a macro for this is because it needs to be done on a lot of files, and my attempts to unpack the files programmatically and edit the xmls inside have been unsuccessful as I can not pack them again without them being corrupted.
I am trying to enable printing of row and column headers in Calc (OpenOffice 4.1.3, win10) with a macro, that runs when printing.
The macro I have written does not throw any errors, and when I ask it to output the value of the printHeaders option, the output is correct.
However the printout does not have the headers and when looking in Format > Page... > Print, printing of headers is not on.
This is my macro as of now;
Code: Select all
sub PrintRowLineNumbers
dim document as object
dim styleFamilies as Object
dim pageStyles as Object
dim defPage as Object
document = thisComponent
styleFamilies = document.styleFamilies
pageStyles = styleFamilies.getByName("PageStyles")
defPage = pageStyles.getByName("Default")
defPage.PrintHeaders = 1
end sub
Any help will be greatly appreciated.
Note: The reason why I want to use a macro for this is because it needs to be done on a lot of files, and my attempts to unpack the files programmatically and edit the xmls inside have been unsuccessful as I can not pack them again without them being corrupted.