Closed tpcarman closed 6 years ago
When configuring a custom TableStyle and setting as default, the custom border colour is not applied unless the Style parameter is specified
`document Test -Verbose {
DocumentOption -EnableSectionNumbering -PageSize A4 -DefaultFont 'Segoe UI' -MarginLeftAndRight 72 -MarginTopAndBottom 72 Style -Name 'Heading 1' -Size 16 -Color 00B050 -Font 'Segoe UI' Style -Name 'Heading 2' -Size 14 -Color 00B050 -Font 'Segoe UI' Style -Name 'TOC' -Size 16 -Color 00B050 -Font 'Segoe UI' Style -Name 'Normal' -Size 10 -Font 'Segoe UI' -Default Style -Name 'TableDefaultHeading' -Size 10 -Color FFFFFF -BackgroundColor 7F7F7F -Font 'Segoe UI' Style -Name 'TableDefaultRow' -Size 10 -Font 'Segoe UI' Style -Name 'TableDefaultAltRow' -Size 10 -BackgroundColor DDDDDD -Font 'Segoe UI' TableStyle -Id Custom -HeaderStyle TableDefaultHeading -RowStyle TableDefaultRow -AlternateRowStyle TableDefaultAltRow -BorderColor 7F7F7F -Align Left -BorderWidth 0.5 -Default TOC Section 'Section1' -Style Heading1 { Paragraph 'Test Section1'; Section 'Section2' -Style Heading2 { Paragraph 'Test Section2'; BlankLine Paragraph 'No TableStyle specified - Table formatting applies using default Blue border, all other custom table styles are applied.' Get-Process | Select -First 5 Name,Id | Table -ColumnWidths 50,50 BlankLine Paragraph 'Custom TableStyle specified - Table formatting applies correctly' Get-Process | Select -First 5 Name,Id | Table -ColumnWidths 50,50 -Style Custom } }
} | Export-Document -Path $env:TEMP -PassThru -Format Word | Invoke-Item`
Resolution found in example script 21. Need to use default table style name TableStyle -Id TableDefault
TableStyle -Id TableDefault
When configuring a custom TableStyle and setting as default, the custom border colour is not applied unless the Style parameter is specified
`document Test -Verbose {
} | Export-Document -Path $env:TEMP -PassThru -Format Word | Invoke-Item`