Relocate Method

Microsoft Word Visual Basic

expression.Relocate(Direction)

expression    Required. An expression that returns one of the objects in the Applies To list.

Direction   Required WdRelocate. The direction of the move.

Can be either of the following WdRelocate constants.
wdRelocateUp
wdRelocateDown

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)
ActiveDocument.ActiveWindow.View.Type = wdOutlineView
myRange.Relocate Direction:=wdRelocateDown
		

This example moves the first paragraph in the selection above the previous paragraph.

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