Relocate Method

Applies To

Range object.

Description

In outline view, moves the paragraphs within the specified range after the next visible paragraph or before the previous visible paragraph. Body text moves with a heading only if the body text is collapsed in outline view or if it's part of the range.

Syntax

expression.Relocate(Direction)

expression Required. An expression that returns a Range object.

Direction Required Long. The direction of the move. Can be either of the following WdRelocate constants: wdRelocateUp or wdRelocateDown.

See Also

Move method, MoveDown method, MoveUp method.

Example

This example moves the third, fourth, and fifth paragraphs in the active document below the next (sixth) paragraph.

theStart = ActiveDocument.Paragraphs(3).Range.Start
theEnd = ActiveDocument.Paragraphs(5).Range.End
Set myRange = ActiveDocument.Range(Start:=theStart, End:=theEnd)
ActiveWindow.View.Type = wdOutlineView
myRange.Relocate Direction:=wdRelocateDown
This example moves the first paragraph in the selection above the previous paragraph.

ActiveWindow.View.Type = wdOutlineView
Selection.Paragraphs(1).Range.Relocate Direction:=wdRelocateUp