Excel.RangeSort class

Manages sorting operations on Range objects.

[ API set: ExcelApi 1.2 ]

Extends

Properties

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

Methods

apply(fields, matchCase, hasHeaders, orientation, method)

Perform a sort operation.

[ API set: ExcelApi 1.2 ]

apply(fields, matchCase, hasHeaders, orientationString, method)

Perform a sort operation.

[ API set: ExcelApi 1.2 ]

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original Excel.RangeSort object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.RangeSortData) that contains shallow copies of any loaded child properties from the original object.

Property Details

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

context: RequestContext;

Property Value

RequestContext

Method Details

apply(fields, matchCase, hasHeaders, orientation, method)

Perform a sort operation.

[ API set: ExcelApi 1.2 ]

apply(fields: Excel.SortField[], matchCase?: boolean, hasHeaders?: boolean, orientation?: Excel.SortOrientation, method?: Excel.SortMethod): void;

Parameters

fields
Excel.SortField[]

The list of conditions to sort on.

matchCase
boolean

Optional. Whether to have the casing impact string ordering.

hasHeaders
boolean

Optional. Whether the range has a header.

orientation
Excel.SortOrientation

Optional. Whether the operation is sorting rows or columns.

method
Excel.SortMethod

Optional. The ordering method used for Chinese characters.

Returns

void

apply(fields, matchCase, hasHeaders, orientationString, method)

Perform a sort operation.

[ API set: ExcelApi 1.2 ]

apply(fields: Excel.SortField[], matchCase?: boolean, hasHeaders?: boolean, orientationString?: "Rows" | "Columns", method?: "PinYin" | "StrokeCount"): void;

Parameters

fields
Excel.SortField[]

The list of conditions to sort on.

matchCase
boolean

Optional. Whether to have the casing impact string ordering.

hasHeaders
boolean

Optional. Whether the range has a header.

orientationString
"Rows" | "Columns"

Optional. Whether the operation is sorting rows or columns.

method
"PinYin" | "StrokeCount"

Optional. The ordering method used for Chinese characters.

Returns

void

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original Excel.RangeSort object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.RangeSortData) that contains shallow copies of any loaded child properties from the original object.

toJSON(): {
            [key: string]: string;
        };

Returns

{ [key: string]: string; }