Skip to content

Commit 1d4bd44

Browse files
feat: OpenXML.Word.Table.get_Row ( Fixes #47 )
1 parent a3ac98a commit 1d4bd44

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<#
2+
.SYNOPSIS
3+
Gets Table Rows
4+
.DESCRIPTION
5+
Gets Table Rows, excluding any rows that are a header.
6+
#>
7+
foreach ($row in $this.tr) {
8+
if (-not $row.trPr.psobject.properties) { continue }
9+
if ($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 (-not $row.FilePath) {
15+
$row.psobject.properties.add(
16+
[psnoteproperty]::new("FilePath", $this.FilePath), $false
17+
)
18+
}
19+
if (-not $row.OpenXML) {
20+
$row.psobject.properties.add(
21+
[psnoteproperty]::new("OpenXML", $this.OpenXML), $false
22+
)
23+
}
24+
if (-not $row.Table) {
25+
$row.psobject.properties.add(
26+
[psnoteproperty]::new("Table", $this), $false
27+
)
28+
}
29+
30+
$row
31+
}

0 commit comments

Comments
 (0)