DeleteWhitespace Method

Home Page (Objects)OverviewFAQReference

Applies to: TextSelection object

Deletes white space adjacent to the insertion point.

Syntax

object**.DeleteWhitespace** [direction]

Parameters

object

An expression that evaluates to a TextSelection object.

direction

(Optional) A string constant of type DsWhitespaceOptions that indicates the direction in which the white space is deleted. Possible values are:

  • dsHorizontal   Removes white space to the left and right of the insertion point (the default).

  • dsVertical   Removes blank lines at, above, or below the insertion point.

Remarks

White space includes spaces and tab characters.

Example

For the current selection, the following example deletes whitespace to the left and right of the insertion point:

ActiveDocument.Selection.DeleteWhitespace

See Also   Cut method, Delete method.