Skip to content

Commit 7827a85

Browse files
feat: OpenXML.Word.TableRow.get_Column ( Fixes #52 )
1 parent 2db16bf commit 7827a85

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)