FormattedText Property

Applies To

Range object, Selection object.

Description

Returns or sets a Range object that includes the formatted text in the specified range or selection. Read/write.

Remarks

This property returns a Range object with the character formatting and text from the specified range or selection. Paragraph formatting is included in the Range object if there's a paragraph mark in the range or selection.

When you set this property, the text in the range is replaced with formatted text. If you don't want to replace the existing text, use the Collapse method before using this property (see the first example).

See Also

Bold property, CopyFormat method, Emboss property, Engrave property, Hidden property, Italic property, Kerning property, Shadow property, SmallCaps property, StrikeThrough property, Subscript property, Superscript property, Text property, Underline property.

Example

This example copies the first paragraph in the document, including its formatting, and inserts the formatted text at the insertion point.

Selection.Collapse Direction:=wdCollapseStart
Selection.FormattedText = ActiveDocument.Paragraphs(1).Range
This example copies the text and formatting from the selection into a new document.

Set myRange = Selection.FormattedText
Documents.Add.Content.FormattedText = myRange