API Reference
Cmdlet
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
Example 1: Write a formatted sentence.
PS>
Add-OfficeWordParagraph { Add-OfficeWordText -Text 'Hello '; Add-OfficeWordText -Text 'World' -Bold }
Outputs “Hello World” with the second word bolded.
Example 2: 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.
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 <Nullable`1>] [-PassThru] [-Run <Object[]>] [-Style <Nullable`1>] [-StyleId <String>] [-Text <String>] [<CommonParameters>]#Parameter set:
TextParameters
- Alignment Nullable`1
- Paragraph justification.
- 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 Nullable`1
- 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.
- Text String
- Optional initial paragraph text.
Add-OfficeWordParagraph [-Alignment <Nullable`1>] [-Content <ScriptBlock>] [-PassThru] [-Style <Nullable`1>] [-StyleId <String>] [-Text <String>] [<CommonParameters>]#Parameter set:
ContentParameters
- Alignment Nullable`1
- Paragraph justification.
- Content ScriptBlock
- Nested DSL content (runs, lists, images).
- PassThru SwitchParameter
- Emit the WordParagraph for further use.
- Style Nullable`1
- 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.
- Text String
- Optional initial paragraph text.