GoToPrevious Method

Microsoft Word Visual Basic

Show All

GoToPrevious Method

       

GoToPrevious method as it applies to the Range and Selection objects.

Returns a Range object that refers to the start position of the previous item or location specified by the What argument. If applied to a Selection object, GoToPrevious moves the selection to the specified item. Range object.

expression.GoToPrevious(What)

expression   Required. An expression that returns one of the above objects.

What  Required The item that the specified range or selection is to be moved to. WdGoToItem.

WdGoToItem can be one of these WdGoToItem constants.
wdGoToComment
wdGoToEquation
wdGoToFootnote
wdGoToGraphic
wdGoToLine
wdGoToPage
wdGoToProofreadingError
wdGoToSpellingError
wdGoToBookmark
wdGoToEndnote
wdGoToField
wdGoToGrammaticalError
wdGoToHeading
wdGoToObject
wdGoToPercent
wdGoToSection
wdGoToTable

 

GoToPrevious method as it applies to the MailMessage object.

Displays the previous mail message if you are using Word as your e-mail editor.

expression.GoToPrevious

expression   Required. An expression that returns one of the above objects.

 

Example

This example moves to the previous field in the active document.

Selection.GoToPrevious What:=wdGoToField

This example creates a range that references the last footnote reference marker in the active document.

Set myRange = ActiveDocument.Words.Last _
    .GoToPrevious(What:=wdGoToFootnote)
myRange.Expand Unit:=wdCharacter