SortNow (Method)

Applies To:

SortItems collection

Description:

Sets the Sort Now feature on items placed on the Sort Line in the Results section. The Sort Now feature initiates the sorting function immediately on items on the Sort Line. This method is required to use the SortOrder (Property) (see the Object Model Guide to Properties and Constants).

Syntax:

Expression.SortNow()

Expression Required:

An expression that returns a SortItems collection

Example:

This example shows how to specify the SortNow method for items on the Sort Line in the Table section. In the example, the SortNow method is associated with a command button. When the command button is invoked, the text Start SortNow displays in the first text box. When the script within the try-catch block is executed, the text End SortNow displays in a second text box:

ActiveSection.Shapes["CommandButton1"].OnClick()
TextBox1.Text = "Start SortNow"
try
{
ActiveDocument.Sections["Table"].SortItems.SortNow()}
catch(e)
{
TextBox2.Text = e.toString()
}
TextBox1.Text ="End SortNow"