Last Property
Applies To
Characters collection object, Columns collection object, Paragraphs collection object, Rows collection object, Sections collection object, Sentences collection object, Words collection object.
Description
Sentences, Words, and Characters objects: Returns a Range object that represents the last sentence, word, or character in a document, selection, or range. Read-only.
Columns, Paragraphs, Rows, and Sections objects: Returns the last item in the specified collection. Read-only. For example, both of the following instructions return a Paragraph object that represents the last paragraph in the selection.
Selection.Paragraphs.Last
Selection.Paragraphs(Selection.Paragraphs.Count)
See Also
Count property, First property, Item method.
Example
This example formats the last paragraph in the active document to be right aligned.
ActiveDocument.Paragraphs.Last.Alignment = wdAlignParagraphRight
This example deletes the last row in table one.
ActiveDocument.Tables(1).Rows.Last.Cells.Delete
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