Skip to content

Commit 2db16bf

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: OpenXML.Word.Table.get_Row ( Fixes #47 )
1 parent 1d4bd44 commit 2db16bf

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

OpenXML.types.ps1xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,42 @@ $isFirst = $true
557557
}) -join [Environment]::NewLine
558558
</GetScriptBlock>
559559
</ScriptProperty>
560+
<ScriptProperty>
561+
<Name>Row</Name>
562+
<GetScriptBlock>
563+
&lt;#
564+
.SYNOPSIS
565+
Gets Table Rows
566+
.DESCRIPTION
567+
Gets Table Rows, excluding any rows that are a header.
568+
#&gt;
569+
foreach ($row in $this.tr) {
570+
if (-not $row.trPr.psobject.properties) { continue }
571+
if ($row.trPr.psobject.properties['tblHeader']) { continue }
572+
573+
if ($row.pstypenames -ne 'OpenXML.Word.TableRow') {
574+
$row.pstypenames.insert(0, 'OpenXML.Word.TableRow')
575+
}
576+
if (-not $row.FilePath) {
577+
$row.psobject.properties.add(
578+
[psnoteproperty]::new("FilePath", $this.FilePath), $false
579+
)
580+
}
581+
if (-not $row.OpenXML) {
582+
$row.psobject.properties.add(
583+
[psnoteproperty]::new("OpenXML", $this.OpenXML), $false
584+
)
585+
}
586+
if (-not $row.Table) {
587+
$row.psobject.properties.add(
588+
[psnoteproperty]::new("Table", $this), $false
589+
)
590+
}
591+
592+
$row
593+
}
594+
</GetScriptBlock>
595+
</ScriptProperty>
560596
<ScriptProperty>
561597
<Name>Text</Name>
562598
<GetScriptBlock>

0 commit comments

Comments
 (0)