Skip to content

Commit 00e3cee

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: OpenXML.Word.File.get_Text ( Fixes #9 )
1 parent 070c9c7 commit 00e3cee

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

OpenXML.types.ps1xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,24 @@ foreach ($slide in $slidesInOrder) {
138138
</ScriptProperty>
139139
</Members>
140140
</Type>
141+
<Type>
142+
<Name>OpenXML.Word.File</Name>
143+
<Members>
144+
<ScriptProperty>
145+
<Name>Text</Name>
146+
<GetScriptBlock>
147+
@($this.Parts['/word/document.xml'].Content |
148+
Select-Xml -XPath '//w:t|//w:p' -Namespace @{w='http://schemas.openxmlformats.org/wordprocessingml/2006/main'} |
149+
Foreach-Object {
150+
if ($_.Node.LocalName -eq 't') {
151+
$_.Node.InnerText
152+
} else {
153+
[Environment]::NewLine
154+
}
155+
156+
}) -join ''
157+
</GetScriptBlock>
158+
</ScriptProperty>
159+
</Members>
160+
</Type>
141161
</Types>

0 commit comments

Comments
 (0)