Share via


Selection.FormattedText Property

Returns or sets a Range object that includes the formatted text in the specified selection.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Property FormattedText As Range
    Get
    Set
'Usage
Dim instance As Selection
Dim value As Range

value = instance.FormattedText

instance.FormattedText = value
Range FormattedText { get; set; }

Property Value

Type: Microsoft.Office.Interop.Word.Range

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 Also

Reference

Selection Interface

Selection Members

Microsoft.Office.Interop.Word Namespace