Default header and footer show up when I print out invoice created by macro. I want to remove them in my macro.
Asked
Active
Viewed 1,250 times
1 Answers
0
I found this is the way to turn header and footer off:
Dim oDoc As Object
Dim oSheet As Object
Dim oStyles As Variant
Dim oPstyle As Variant
oDoc=ThisComponent
oSheet=oDoc.Sheets.getByName("Sheet1")
oStyles=oDoc.StyleFamilies.getByName("PageStyles")
oPstyle=oStyles.getByName(oSheet.PageStyle)
oPstyle.HeaderOn=FALSE
oPstyle.FooterOn=FALSE

Maciej
- 9,355
- 2
- 15
- 18