Share via


Indent Method

Home Page (Objects)OverviewFAQReference

Applies to: TextSelection object

Indents text.

Syntax

object**.Indent**

Parameters

object

An expression that evaluates to a TextSelection object.

Remarks

The Indent method has the same effect as pressing the TAB key.

This method indents by the number specified in the IndentSize property. The indent can consist of multiple tab characters, depending on the values of the TabSize property and IndentSize property.

Caution   If text is selected, the Indent method deletes the selection.

You can insert a tab by using the vbTab string constant. Consider the following code:

Dim Sel
Sel=ActiveDocument.Selection
Sel=vbTab

Alternatively, you could use the TextSelection object's Text property, which is the default:

Sel.Text=vbTab

Example

The following example inserts one indent at the insertion point:

ActiveDocument.Selection.Indent

See Also   DestructiveInsert method, NewLine method, Overtype property, Text property, Unindent method.