SortAscending Method

Applies To

Range object, Selection object, Table object.

Description

Sorts paragraphs or table rows in ascending alphanumeric order. The first paragraph or table row is considered a header record and isn't included in the sort. Use the Sort method to include the header record in a sort.

Note   This method offers a simplified form of sorting intended for mail merge data sources that contain columns of data. For most sorting tasks, use the Sort method.

Syntax

expression.SortAscending

expression Required. An expression that returns a Range, Selection, or Table object.

See Also

Sort method, SortDescending method.

Example

This example sorts the table that contains the selection in ascending order.

If Selection.Information(wdWithInTable) = True Then
    Selection.Tables(1).SortAscending
Else
    MsgBox "The insertion point is not in a table."
End If