Selection.Collapse Method

Collapses a selection to the starting or ending position.

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

'Usage
Dim Direction As Object
Dim selection1 As Selection
selection1.Collapse(Direction)

void Collapse(
	[In, Optional] ref object Direction
);
public void Collapse(
	/*in*/System.Object Direction
);
function Collapse(
	 Direction : Object
);

Parameters

Direction

Optional Object. The direction in which to collapse the selection.

Can be either of the following WdCollapseDirection constants: wdCollapseEnd or wdCollapseStart. The default value is wdCollapseStart.

If you use wdCollapseEnd to collapse a selection that refers to an entire paragraph, the selection is located after the ending paragraph mark (the beginning of the next paragraph). However, you can move the selection back one character by using the MoveEnd method after the selection is collapsed.


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

Development Platforms

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

Target Platforms

Anzeigen: