I originally asked the question on March 2. I have learned a lot since then, but the fundamental question remains: How do I create PageStyles? I know that I can manually create and apply them through the IDE. I want to use a program to do it. I have found a number of parameters related to the pagestyle(LibreOffice: PageProperties Service Reference).
I need to be able to do the following:
-
Find the methods used to add and assign a pagestyle.
-
Find the parameters required to change the Text attributes on the header and footer (specifically the size and Bold/Italic/Underline).
-
Parameters to locate (Left/Center/Right) the fields in the Left/Center/Right areas of the header/footer.
-
Now the tough one. In the IDE I can add Sheet Name, Page, Pages, Date, Time. These are all dynamic items. For example, the Time option. I can add the time (Time()) however that is static. Regardless of when I print the spreadsheet, the date remains the same. However if I select the Time option in the IDE, this is dynamic. Whenever I print the spreadsheet, the time on the header/footer will be the current time.
I tried to trick it. The center field in the Header is the Sheet name. In my case it is one of the 12 months, or Summary. I tried different things to get what I need:
'*************************************************************************
HContent = .RightPageHeaderContent 'Right header sets right and left pages
With HContent
HText = .LeftText
HText.String = date() 'Current static date
HText = .CenterText'************************************************************************* 'HText.string = "John " & HText.string 'Result is "John ???" 'HText.String = sheet.name 'Puts the same name on all sheets 'If HText.string is not set each page has the correct page name '************************************************************************* HText =.RightText HText.String = Time() 'Current static date End With .RightPageHeaderContent = HContent 'Restore Header content '*************************************************************************
I thought that the HText string for the Sheet name might have some unprintable characters. It does not. I need to be able to add these fields to the header/footer.
Any help on any of these items would be greatly appreciated.
Thank you
John