API Reference
Cmdlet
Join-OfficeWordDocument
Appends one or more Word documents into a base Word document.
Remarks
Uses OfficeIMO.Word document append support and preserves the wrapper as an operator-friendly merge command.
Examples
Merge a cover, body, and appendix into a release packet.
PS>
$proof = @(
Join-OfficeWordDocument -Path .\Cover.docx -AppendPath .\Body.docx, .\Appendix.docx -OutputPath .\ReleasePacket.docx
Get-OfficeWordStatistics -Path .\ReleasePacket.docx |
Select-Object -Property Paragraphs, Tables, Images
)
$proof
Appends the source documents with OfficeIMO.Word and then reads back basic structure from the merged output.
Append into an already-open document object.
PS>
$doc = Get-OfficeWord -Path .\Base.docx
$doc | Join-OfficeWordDocument -AppendPath .\Section1.docx, .\Section2.docx -PassThru |
Save-OfficeWord -Path .\Combined.docx
Keeps the wrapper thin by piping the OfficeIMO document object through append and save commands.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Join-OfficeWordDocument -AppendPath <String[]> -InputPath <String> [-OutputPath <String>] [-PassThru] [-Show] [<CommonParameters>]#Parameter set:
PathParameters
- AppendPath String[]
- Documents to append to the base document.
- InputPath String
- Base document path.
- OutputPath String
- Optional output path. When omitted for path input, the base document is updated in place.
- PassThru SwitchParameter
- Emit the merged Word document instead of disposing it.
- Show SwitchParameter
- Open the saved output with the shell.
Outputs
OfficeIMO.Word.WordDocument
Join-OfficeWordDocument -AppendPath <String[]> -Document <WordDocument> [-OutputPath <String>] [-PassThru] [-Show] [<CommonParameters>]#Parameter set:
DocumentParameters
- AppendPath String[]
- Documents to append to the base document.
- Document WordDocument
- Base document object.
- OutputPath String
- Optional output path. When omitted for path input, the base document is updated in place.
- PassThru SwitchParameter
- Emit the merged Word document instead of disposing it.
- Show SwitchParameter
- Open the saved output with the shell.
Outputs
OfficeIMO.Word.WordDocument