Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeWordText

Aliases: WordText
Module
PSWriteOffice
Aliases
WordText
Inputs
OfficeIMO.Word.WordParagraph
Outputs
OfficeIMO.Word.WordParagraph OfficeIMO.Word.WordHyperLink

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: Text
Add-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: Link
Add-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: Anchor

Description

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 optional
Run highlight or shading color; explicit null clears both.
-Baseline OfficeTextBaseline optional
Normal, superscript or subscript baseline.
Possible values: Normal, Superscript, Subscript
-Bold SwitchParameter optional
Apply bold formatting.
-Color OfficeColor optional
Text color, including a semantic theme role.
-Font String optional
Font family.
-Italic SwitchParameter optional
Apply italic formatting.
-Paragraph WordParagraph optionalpipeline: True (ByValue)
Paragraph to receive text outside a content block.
-PassThru SwitchParameter optional
Emit each newly created run, or each hyperlink for Link and Anchor.
-Size OfficeLength optional
Font size; a bare number means points.
-Strikethrough SwitchParameter optional
Apply strikethrough.
-Text String[] requiredposition: 0
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
Absolute hyperlink URL.
-NoHistory SwitchParameter optionalsets: Link, Anchor
Disable hyperlink navigation history.
-NoLinkStyle SwitchParameter optionalsets: Link, Anchor
Do not apply the built-in Hyperlink character style.
-Tooltip String optionalsets: Link, Anchor
Hyperlink tooltip.
-Anchor String requiredsets: Anchor
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.