Skip to content

Commit 2f504c4

Browse files
feat: OpenXML.Word.Table.get_Header ( Fixes #46 )
1 parent 5b64c9c commit 2f504c4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<#
2+
.SYNOPSIS
3+
Gets Table Header
4+
.DESCRIPTION
5+
Gets Table Row that are header rows.
6+
#>
7+
foreach ($row in $this.tr) {
8+
if (-not $row.trPr.psobject.properties) { continue }
9+
if (-not $row.trPr.psobject.properties['tblHeader']) { continue }
10+
11+
if ($row.pstypenames -ne 'OpenXML.Word.TableRow') {
12+
$row.pstypenames.insert(0, 'OpenXML.Word.TableRow')
13+
}
14+
if ($row.pstypenames -ne 'OpenXML.Word.TableHeader') {
15+
$row.pstypenames.insert(0, 'OpenXML.Word.TableHeader')
16+
}
17+
if (-not $row.FilePath) {
18+
$row.psobject.properties.add(
19+
[psnoteproperty]::new("FilePath", $this.FilePath), $false
20+
)
21+
}
22+
if (-not $row.OpenXML) {
23+
$row.psobject.properties.add(
24+
[psnoteproperty]::new("OpenXML", $this.OpenXML), $false
25+
)
26+
}
27+
if (-not $row.Table) {
28+
$row.psobject.properties.add(
29+
[psnoteproperty]::new("Table", $this), $false
30+
)
31+
}
32+
33+
$row
34+
}

0 commit comments

Comments
 (0)