Skip to content

Latest commit

 

History

History
59 lines (34 loc) · 1.13 KB

Word.Selection.Text.md

File metadata and controls

59 lines (34 loc) · 1.13 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Selection.Text property (Word)
vbawd10.chm158662656
vbawd10.chm158662656
Word.Selection.Text
2acf885b-8d4a-7ebc-79aa-902921bc33bb
06/08/2017
medium

Selection.Text property (Word)

Returns or sets the text in the specified selection. Read/write String.

Syntax

expression.Text

expression A variable that represents a Selection object.

Remarks

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

Example

This example displays the text in the selection. If nothing is selected, the character following the insertion point is displayed.

MsgBox Selection.Text

This example inserts 10 lines of text into a new document.

Documents.Add 
For i = 1 To 10 
 Selection.Text = "Line" & Str(i) & Chr(13) 
 Selection.MoveDown Unit:=wdParagraph, Count:=1 
Next i

See also

Selection Object

[!includeSupport and feedback]