Cmdlet
Add-OfficeWordText
Adds styled text or a hyperlink to the current or given Word paragraph.
Syntax
Add-OfficeWordText
[-BackgroundColor <OfficeColor>]
[-Baseline <Normal| Superscript| Subscript>]
[-Bold]
[-Color <OfficeColor>]
[-Font <String>]
[-Italic]
[-Paragraph <WordParagraph>]
[-PassThru]
[-Size <OfficeLength>]
[-Strikethrough]
[-Text] <String[]>
[-Underline <WordUnderlineStyle>]
[<CommonParameters>]#Parameter set:
TextAdd-OfficeWordText
[-BackgroundColor <OfficeColor>]
[-Baseline <Normal| Superscript| Subscript>]
[-Bold]
[-Color <OfficeColor>]
[-Font <String>]
[-Italic]
-Link <Uri>
[-NoHistory]
[-NoLinkStyle]
[-Paragraph <WordParagraph>]
[-PassThru]
[-Size <OfficeLength>]
[-Strikethrough]
[-Text] <String[]>
[-Tooltip <String>]
[-Underline <WordUnderlineStyle>]
[<CommonParameters>]#Parameter set:
LinkAdd-OfficeWordText
-Anchor <String>
[-BackgroundColor <OfficeColor>]
[-Baseline <Normal| Superscript| Subscript>]
[-Bold]
[-Color <OfficeColor>]
[-Font <String>]
[-Italic]
[-NoHistory]
[-NoLinkStyle]
[-Paragraph <WordParagraph>]
[-PassThru]
[-Size <OfficeLength>]
[-Strikethrough]
[-Text] <String[]>
[-Tooltip <String>]
[-Underline <WordUnderlineStyle>]
[<CommonParameters>]#Parameter set:
AnchorDescription
A bare Size means points; unit-suffixed lengths are accepted. Hyperlinks use the Hyperlink style unless NoLinkStyle is supplied.
Examples
Append styled text.
WordParagraph { WordText 'Important: ' -Bold -Font Aptos -Size 11pt; WordText 'read first' -Italic }Add a link and a bookmark reference.
WordParagraph { WordText 'Example' -Link 'https://example.org' -Tooltip 'External reference'; WordText 'Summary' -Anchor Summary }Parameters
- -BackgroundColor OfficeColor
- Run highlight or shading color; explicit null clears both.
- -Baseline OfficeTextBaseline
- Normal, superscript or subscript baseline.
- Possible values:
Normal,Superscript,Subscript - -Bold SwitchParameter
- Apply bold formatting.
- -Color OfficeColor
- Text color, including a semantic theme role.
- -Font String
- Font family.
- -Italic SwitchParameter
- Apply italic formatting.
- -Paragraph WordParagraph
- Paragraph to receive text outside a content block.
- -PassThru SwitchParameter
- Emit each newly created run, or each hyperlink for Link and Anchor.
- -Size OfficeLength
- Font size; a bare number means points.
- -Strikethrough SwitchParameter
- Apply strikethrough.
- -Text String[]
- Text segments to append.
- -Underline WordUnderlineStyle
- Underline style.
- Possible values:
Single,Words,Double,Thick,Dotted,DottedHeavy,Dash,DashedHeavy,DashLong,DashLongHeavy,DotDash,DashDotHeavy,DotDotDash,DashDotDotHeavy,Wave,WavyHeavy,WavyDouble - -Link Uri
- Absolute hyperlink URL.
- -NoHistory SwitchParameter
- Disable hyperlink navigation history.
- -NoLinkStyle SwitchParameter
- Do not apply the built-in Hyperlink character style.
- -Tooltip String
- Hyperlink tooltip.
- -Anchor String
- Bookmark target in this 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.