Skip to content

Commit d8c46ff

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: OpenXML.Word.TableRow.get_Column ( Fixes #52 )
1 parent 7827a85 commit d8c46ff

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

OpenXML.types.ps1xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,4 +614,51 @@ foreach ($row in $this.tr) {
614614
</ScriptProperty>
615615
</Members>
616616
</Type>
617+
<Type>
618+
<Name>OpenXML.Word.TableRow</Name>
619+
<Members>
620+
<ScriptProperty>
621+
<Name>Column</Name>
622+
<GetScriptBlock>
623+
&lt;#
624+
.SYNOPSIS
625+
Gets word table columns
626+
.DESCRIPTION
627+
Gets columns in a word table
628+
#&gt;
629+
foreach ($column in $this.tr) {
630+
if (-not $column.trPr.psobject.properties) { continue }
631+
if ($column.trPr.psobject.properties['tblHeader']) { continue }
632+
633+
if ($column.pstypenames -ne 'OpenXML.Word.TableColumn') {
634+
$column.pstypenames.insert(0, 'OpenXML.Word.TableColumn')
635+
}
636+
if (-not $column.FilePath) {
637+
$column.psobject.properties.add(
638+
[psnoteproperty]::new("FilePath", $this.FilePath), $false
639+
)
640+
}
641+
if (-not $column.OpenXML) {
642+
$column.psobject.properties.add(
643+
[psnoteproperty]::new("OpenXML", $this.OpenXML), $false
644+
)
645+
}
646+
if (-not $column.Table) {
647+
$column.psobject.properties.add(
648+
[psnoteproperty]::new("Table", $this.Table), $false
649+
)
650+
}
651+
652+
if (-not $column.Row) {
653+
$column.psobject.properties.add(
654+
[psnoteproperty]::new("Row", $this), $false
655+
)
656+
}
657+
658+
$column
659+
}
660+
</GetScriptBlock>
661+
</ScriptProperty>
662+
</Members>
663+
</Type>
617664
</Types>

0 commit comments

Comments
 (0)