API Reference
Add-OfficeWordParagraph
Adds a paragraph to the current section/header/footer context.
Remarks
Acts as the primary DSL container for inline content such as text runs, bold segments, and images.
Examples
Write a formatted sentence.
PS>
Add-OfficeWordParagraph { Add-OfficeWordText -Text 'Hello '; Add-OfficeWordText -Text 'World' -Bold }
Outputs “Hello World” with the second word bolded.
Apply a paragraph style by id.
PS>
WordParagraph -Text 'Executive summary' -StyleId 'ReportHeading'
Applies a paragraph style id, including custom styles already present in a template document.
Add mixed-format text through explicit objects.
PS>
$paragraph = $document | Add-OfficeWordParagraph -PassThru
$paragraph | Add-OfficeWordText -Run @{ Text = 'Owner: ', 'Platform'; Bold = $true, $false }
Creates a paragraph on a live document and appends two differently formatted runs.
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
Add-OfficeWordParagraph [-Alignment <Left>] [-PassThru] [-Run <Object[]>] [-Style <Normal>] [-StyleId <String>] [-Target <Object>] [-Text <String>] [<CommonParameters>]#TextParameters
- Alignment WordParagraphAlignment
- Paragraph justification.
- Possible values:
Left,Start,Center,Right,End,Both,MediumKashida,Distribute,NumTab,HighKashida,LowKashida,ThaiDistribute - PassThru SwitchParameter
- Emit the WordParagraph for further use.
- Run Object[]
- Rich text runs. Each run can be created with TextRun/WordTextRun or provided as a hashtable/object.
- Style WordParagraphStyles
- Paragraph style.
- Possible values:
Normal,Heading1,Heading2,Heading3,Heading4,Heading5,Heading6,Heading7,Heading8,Heading9,ListParagraph,Custom - StyleId String
- Paragraph style id, including custom style ids from a template document.
- Target Object
- Document or section that will receive the paragraph.
- Text String
- Optional initial paragraph text.
Outputs
OfficeIMO.Word.WordParagraph
Add-OfficeWordParagraph [-Alignment <Left>] [-Content <ScriptBlock>] [-PassThru] [-Style <Normal>] [-StyleId <String>] [-Target <Object>] [-Text <String>] [<CommonParameters>]#ContentParameters
- Alignment WordParagraphAlignment
- Paragraph justification.
- Possible values:
Left,Start,Center,Right,End,Both,MediumKashida,Distribute,NumTab,HighKashida,LowKashida,ThaiDistribute - Content ScriptBlock
- Nested DSL content (runs, lists, images).
- PassThru SwitchParameter
- Emit the WordParagraph for further use.
- Style WordParagraphStyles
- Paragraph style.
- Possible values:
Normal,Heading1,Heading2,Heading3,Heading4,Heading5,Heading6,Heading7,Heading8,Heading9,ListParagraph,Custom - StyleId String
- Paragraph style id, including custom style ids from a template document.
- Target Object
- Document or section that will receive the paragraph.
- Text String
- Optional initial paragraph text.
Outputs
OfficeIMO.Word.WordParagraph