API Reference
Cmdlet
Add-OfficeWordText
Adds inline text to the current paragraph.
Remarks
Supports bold/italic/underline and color tweaks for quick DSL composition.
Examples
Append bold text.
PS>
Add-OfficeWordParagraph { Add-OfficeWordText -Text 'Important: ' -Bold }
Writes “Important:” with bold formatting.
Append several styled segments to a paragraph.
PS>
$paragraph | Add-OfficeWordText -Run @{ Text = 'Status: ', 'Ready'; Bold = $true, $false; Color = $null, 'SeaGreen' }
Appends one line with independent formatting for its label and value.
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-OfficeWordText [-Bold] [-Color <String>] [-FontName <String>] [-FontSize <Int32>] [-Italic] [-Paragraph <WordParagraph>] [-PassThru] [-Strike] -Text <String[]> [-Underline <Single>] [<CommonParameters>]#Parameter set:
TextParameters
- Bold SwitchParameter
- Apply bold formatting.
- Color String
- Run color. Named colors and hexadecimal values are accepted.
- FontName String
- Font name or family.
- FontSize Int32
- Font size in points.
- Italic SwitchParameter
- Apply italic formatting.
- Paragraph WordParagraph
- Paragraph that will receive the text outside a DSL context.
- PassThru SwitchParameter
- Emit the target paragraph for further composition.
- Strike SwitchParameter
- Render text with strikethrough.
- Text String[]
- Text segments to append.
- Underline WordUnderlineStyle
- Optional underline style.
- Possible values:
Single,Words,Double,Thick,Dotted,DottedHeavy,Dash,DashedHeavy,DashLong,DashLongHeavy,DotDash,DashDotHeavy,DotDotDash,DashDotDotHeavy,Wave,WavyHeavy,WavyDouble
Outputs
OfficeIMO.Word.WordParagraph
Add-OfficeWordText [-Bold] [-Color <String>] [-FontName <String>] [-FontSize <Int32>] [-Italic] [-Paragraph <WordParagraph>] [-PassThru] -Run <Object[]> [-Strike] [-Underline <Single>] [<CommonParameters>]#Parameter set:
RunParameters
- Bold SwitchParameter
- Apply bold formatting.
- Color String
- Run color. Named colors and hexadecimal values are accepted.
- FontName String
- Font name or family.
- FontSize Int32
- Font size in points.
- Italic SwitchParameter
- Apply italic formatting.
- Paragraph WordParagraph
- Paragraph that will receive the text outside a DSL context.
- PassThru SwitchParameter
- Emit the target paragraph for further composition.
- Run Object[]
- Rich text runs. Each run can be created with TextRun/WordTextRun or provided as a hashtable/object.
- Strike SwitchParameter
- Render text with strikethrough.
- Underline WordUnderlineStyle
- Optional underline style.
- Possible values:
Single,Words,Double,Thick,Dotted,DottedHeavy,Dash,DashedHeavy,DashLong,DashLongHeavy,DotDash,DashDotHeavy,DotDotDash,DashDotDotHeavy,Wave,WavyHeavy,WavyDouble
Outputs
OfficeIMO.Word.WordParagraph