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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk