Excel.RangeView class

RangeView 表示父范围的一组可见单元格。RangeView represents a set of visible cells of the parent range.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

Extends

属性

cellAddresses

表示 RangeView 的单元格地址。Represents the cell addresses of the RangeView. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

columnCount

返回可见列数。Returns the number of visible columns. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

context

与该对象关联的请求上下文。The request context associated with the object. 这会将加载项的进程连接到 Office 主机应用程序的进程。This connects the add-in's process to the Office host application's process.

formulas

表示采用 A1 表示法的公式。Represents the formula in A1-style notation.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

formulasLocal

表示采用 A1 表示法的公式,使用用户语言和数字格式区域设置。例如,英语中的公式 "=SUM(A1, 1.5)" 在德语中变为 "=SUMME(A1; 1,5)"。Represents the formula in A1-style notation, in the user's language and number-formatting locale. For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

formulasR1C1

表示采用 R1C1 表示法的公式。Represents the formula in R1C1-style notation.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

index

返回表示 RangeView 的索引的值。Returns a value that represents the index of the RangeView. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

numberFormat

表示 Excel 中指定单元格的数字格式代码。Represents Excel's number format code for the given cell.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

rowCount

返回可见行数。Returns the number of visible rows. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

rows

表示一组与 range 相关联的 RangeView。Represents a collection of range views associated with the range. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

text

指定区域的文本值。Text values of the specified range. 文本值与单元格宽度无关。The Text value will not depend on the cell width. Excel # UI 中发生的符号替换不会影响 API 返回的文本值。The # sign substitution that happens in Excel UI will not affect the text value returned by the API. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

values

表示指定的 RangeView 的原始值。Represents the raw values of the specified range view. 返回的数据可能是字符串、数字,也可能是布尔值。The data returned could be of type string, number, or a boolean. 包含错误的单元格将返回错误字符串。Cells that contain an error will return the error string.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

valueTypes

表示每个单元格的数据类型。Represents the type of data of each cell. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

方法

getRange()

获取与当前 RangeView 相关联的父 range。Gets the parent range associated with the current RangeView.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

load(option)

将命令加入队列以加载对象的指定属性。Queues up a command to load the specified properties of the object. 在读取属性之前,你必须调用“context.sync()”。You must call "context.sync()" before reading the properties.

load(propertyNames)

将命令加入队列以加载对象的指定属性。Queues up a command to load the specified properties of the object. 在读取属性context.sync()之前, 必须先调用。You must call context.sync() before reading the properties.

load(propertyNamesAndPaths)

将命令加入队列以加载对象的指定属性。Queues up a command to load the specified properties of the object. 在读取属性context.sync()之前, 必须先调用。You must call context.sync() before reading the properties.

set(properties, options)

同时设置一个对象的多个属性。Sets multiple properties of an object at the same time. 您可以传递具有相应属性的纯对象或相同类型的其他 API 对象。You can pass either a plain object with the appropriate properties, or another API object of the same type.

set(properties)

基于现有加载的对象同时设置该对象的多个属性。Sets multiple properties on the object at the same time, based on an existing loaded object.

toJSON()

重写 JavaScript toJSON()方法, 以便在将 API 对象传递到时提供更有用的输出JSON.stringify()Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify反过来, 也会调用传递toJSON给它的对象的方法。尽管原始 RangeView 对象是 API 对象, 但toJSON方法返回一个无格式的 JavaScript 对象 (类型为Excel.Interfaces.RangeViewData, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original Excel.RangeView object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.RangeViewData), 其中包含原始对象中所有已加载的子属性的浅表副本。) that contains shallow copies of any loaded child properties from the original object.

属性详细信息

cellAddresses

表示 RangeView 的单元格地址。Represents the cell addresses of the RangeView. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

readonly cellAddresses: any[][];

属性值

any[][]

columnCount

返回可见列数。Returns the number of visible columns. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

readonly columnCount: number;

属性值

number

context

与该对象关联的请求上下文。The request context associated with the object. 这会将加载项的进程连接到 Office 主机应用程序的进程。This connects the add-in's process to the Office host application's process.

context: RequestContext;

属性值

RequestContext

formulas

表示采用 A1 表示法的公式。Represents the formula in A1-style notation.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

formulas: any[][];

属性值

any[][]

formulasLocal

表示采用 A1 表示法的公式,使用用户语言和数字格式区域设置。例如,英语中的公式 "=SUM(A1, 1.5)" 在德语中变为 "=SUMME(A1; 1,5)"。Represents the formula in A1-style notation, in the user's language and number-formatting locale. For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

formulasLocal: any[][];

属性值

any[][]

formulasR1C1

表示采用 R1C1 表示法的公式。Represents the formula in R1C1-style notation.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

formulasR1C1: any[][];

属性值

any[][]

index

返回表示 RangeView 的索引的值。Returns a value that represents the index of the RangeView. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

readonly index: number;

属性值

number

numberFormat

表示 Excel 中指定单元格的数字格式代码。Represents Excel's number format code for the given cell.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

numberFormat: any[][];

属性值

any[][]

rowCount

返回可见行数。Returns the number of visible rows. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

readonly rowCount: number;

属性值

number

rows

表示一组与 range 相关联的 RangeView。Represents a collection of range views associated with the range. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

readonly rows: Excel.RangeViewCollection;

属性值

text

指定区域的文本值。Text values of the specified range. 文本值与单元格宽度无关。The Text value will not depend on the cell width. Excel # UI 中发生的符号替换不会影响 API 返回的文本值。The # sign substitution that happens in Excel UI will not affect the text value returned by the API. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

readonly text: string[][];

属性值

string[][]

values

表示指定的 RangeView 的原始值。Represents the raw values of the specified range view. 返回的数据可能是字符串、数字,也可能是布尔值。The data returned could be of type string, number, or a boolean. 包含错误的单元格将返回错误字符串。Cells that contain an error will return the error string.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

values: any[][];

属性值

any[][]

valueTypes

表示每个单元格的数据类型。Represents the type of data of each cell. 只读。Read-only.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

readonly valueTypes: Excel.RangeValueType[][];

属性值

Excel.RangeValueType[][]

方法详细信息

getRange()

获取与当前 RangeView 相关联的父 range。Gets the parent range associated with the current RangeView.

[API 集: ExcelApi 1.3][ API set: ExcelApi 1.3 ]

getRange(): Excel.Range;

返回

load(option)

将命令加入队列以加载对象的指定属性。Queues up a command to load the specified properties of the object. 在读取属性之前,你必须调用“context.sync()”。You must call "context.sync()" before reading the properties.

load(option?: Excel.Interfaces.RangeViewLoadOptions): Excel.RangeView;

参数

返回

注解

除了此签名之外, 此方法还具有以下签名:In addition to this signature, this method has the following signatures:

load(option?: string | string[]): Excel.RangeView-Where 选项是一个逗号分隔的字符串或一个字符串数组, 用于指定要加载的属性。load(option?: string | string[]): Excel.RangeView - Where option is a comma-delimited string or an array of strings that specify the properties to load.

load(option?: { select?: string; expand?: string; }): Excel.RangeView-Where 选项。选择是一个用逗号分隔的字符串, 用于指定要加载的属性和选项。 expand 是一个用逗号分隔的字符串, 用于指定要加载的导航属性。load(option?: { select?: string; expand?: string; }): Excel.RangeView - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load.

load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.RangeView-仅适用于集合类型。load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.RangeView - Only available on collection types. 它类似于前面的签名。It is similar to the preceding signature. top 指定结果中可包含的集合项的最大数量。Option.top specifies the maximum number of collection items that can be included in the result. 选项。 skip 指定要跳过且不包含在结果中的项目数。Option.skip specifies the number of items that are to be skipped and not included in the result. 如果指定了 top 选项, 则在跳过指定数目的项目后将启动结果集。If option.top is specified, the result set will start after skipping the specified number of items.

load(propertyNames)

将命令加入队列以加载对象的指定属性。Queues up a command to load the specified properties of the object. 在读取属性context.sync()之前, 必须先调用。You must call context.sync() before reading the properties.

load(propertyNames?: string | string[]): Excel.RangeView;

参数

propertyNames
string | string[]

一个以逗号分隔的字符串或字符串数组, 用于指定要加载的属性。A comma-delimited string or an array of strings that specify the properties to load.

返回

load(propertyNamesAndPaths)

将命令加入队列以加载对象的指定属性。Queues up a command to load the specified properties of the object. 在读取属性context.sync()之前, 必须先调用。You must call context.sync() before reading the properties.

load(propertyNamesAndPaths?: { select?: string; expand?: string; }): Excel.RangeView;

参数

propertyNamesAndPaths
{ select?: string; expand?: string; }

其中, propertyNamesAndPaths 是用逗号分隔的字符串, 用于指定要加载的属性和 propertyNamesAndPaths。扩展是一个用逗号分隔的字符串, 用于指定要加载的导航属性。Where propertyNamesAndPaths.select is a comma-delimited string that specifies the properties to load, and propertyNamesAndPaths.expand is a comma-delimited string that specifies the navigation properties to load.

返回

set(properties, options)

同时设置一个对象的多个属性。Sets multiple properties of an object at the same time. 您可以传递具有相应属性的纯对象或相同类型的其他 API 对象。You can pass either a plain object with the appropriate properties, or another API object of the same type.

set(properties: Interfaces.RangeViewUpdateData, options?: OfficeExtension.UpdateOptions): void;

参数

properties
Interfaces.RangeViewUpdateData

一个 JavaScript 对象, 其属性的结构 isomorphically 为在其上调用方法的对象的属性。A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called.

options
OfficeExtension.UpdateOptions

提供一个选项, 以在 properties 对象尝试设置任何只读属性时禁止显示错误。Provides an option to suppress errors if the properties object tries to set any read-only properties.

返回

void

注解

此方法具有以下附加签名:This method has the following additional signature:

set(properties: Excel.RangeView): void

set(properties)

基于现有加载的对象同时设置该对象的多个属性。Sets multiple properties on the object at the same time, based on an existing loaded object.

set(properties: Excel.RangeView): void;

参数

properties
Excel.RangeView

返回

void

toJSON()

重写 JavaScript toJSON()方法, 以便在将 API 对象传递到时提供更有用的输出JSON.stringify()Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify反过来, 也会调用传递toJSON给它的对象的方法。尽管原始 RangeView 对象是 API 对象, 但toJSON方法返回一个无格式的 JavaScript 对象 (类型为Excel.Interfaces.RangeViewData, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original Excel.RangeView object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.RangeViewData), 其中包含原始对象中所有已加载的子属性的浅表副本。) that contains shallow copies of any loaded child properties from the original object.

toJSON(): Excel.Interfaces.RangeViewData;

返回