Excel.RangeSort class
Manages sorting operations on Range
objects.
- Extends
Remarks
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, match |
Perform a sort operation. |
apply(fields, match |
Perform a sort operation. |
toJSON() | Overrides the JavaScript |
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
Method Details
apply(fields, matchCase, hasHeaders, orientation, method)
Perform a sort operation.
apply(fields: Excel.SortField[], matchCase?: boolean, hasHeaders?: boolean, orientation?: Excel.SortOrientation, method?: Excel.SortMethod): void;
Parameters
- fields
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
Remarks
apply(fields, matchCase, hasHeaders, orientationString, methodString)
Perform a sort operation.
apply(fields: Excel.SortField[], matchCase?: boolean, hasHeaders?: boolean, orientationString?: "Rows" | "Columns", methodString?: "PinYin" | "StrokeCount"): void;
Parameters
- fields
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.
- methodString
-
"PinYin" | "StrokeCount"
Optional. The ordering method used for Chinese characters.
Returns
void
Remarks
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; }
Office Add-ins