Share via


Selection.Text Property 

Returns or sets the text in the specified selection.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Dim selection1 As Selection

Dim returnValue As String
returnValue = selection1.Text

Dim sampleValue As String
selection1.Text = sampleValue

Syntax

Property Text() As String
string Text {get; set;}
property String^ Text{
    String^ get();
    Void set(String^);
}
public System.String get_Text();
public void set_Text(System.String);
function get Text() : String;
function set Text(String);

Remarks

The Text property returns the plain, unformatted text of the selection or range. When you set this property, the text of the range or selection is replaced.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Selection Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

Selection Members