Last Property

Microsoft Word Visual Basic

Returns the last item in the Columns collection as a Column object.

expression.Last

expression    Required. An expression that returns a Columns object.

ShowLast property as it applies to the Paragraphs object.

Returns the last item in the Paragraphs collection as a Paragraph object.

expression.Last

expression    Required. An expression that returns a Paragraphs object.

ShowLast property as it applies to the Characters, Sentences, and Words objects.

Returns a Range object that represents the last character, word, or sentence in a document, selection, or range.

expression.Last

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

ShowLast property as it applies to the Rows object.

Returns the last item in the Rows collection as a Row object.

expression.Last

expression    Required. An expression that returns a Rows object.

ShowLast property as it applies to the Sections object.

Returns the last item in the Sections collection as a Section object.

expression.Last

expression    Required. An expression that returns a Sections object.

Example

ShowAs it applies to the Paragraphs object.

This example formats the last paragraph in the active document to be right-aligned.

ActiveDocument.Paragraphs.Last.Alignment = wdAlignParagraphRight
				

ShowAs it applies to the Words object.

This example applies bold formatting to the last word in the selection.

If Selection.Words.Count >= 2 Then
    Selection.Words.Last.Bold = True
End If
				

ShowAs it applies to the Rows object.

This example deletes the last row in table one.

ActiveDocument.Tables(1).Rows.Last.Cells.Delete