workbookRangeFormat 资源类型workbookRangeFormat resource type

命名空间:microsoft.graphNamespace: microsoft.graph


/betaMicrosoft Graph 中的版本下的 api 可能会发生更改。APIs under the /beta version in Microsoft Graph are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported. 若要确定 API 在 v1.0 中是否可用,请使用 版本 选择器。To determine whether an API is available in v1.0, use the Version selector.

一个格式对象,其中封装了区域的字体、填充、边框、对齐方式和其他属性。A format object encapsulating the range's font, fill, borders, alignment, and other properties.


方法Method 返回类型Return Type 说明Description
获取 workbookRangeFormatGet workbookRangeFormat workbookRangeFormatworkbookRangeFormat 读取 rangeFormat 对象的属性和关系。Read properties and relationships of rangeFormat object.
创建 workbookRangeBorderCreate workbookRangeBorder workbookRangeBorderworkbookRangeBorder 通过发布到边框集合创建新的 RangeBorder。Create a new RangeBorder by posting to the borders collection.
列出边框List borders workbookRangeBorder 集合workbookRangeBorder collection 获取 RangeBorder 对象集合。Get a RangeBorder object collection.
更新Update workbookRangeFormatworkbookRangeFormat 更新 RangeFormat 对象。Update RangeFormat object.
AutofitcolumnsAutofitcolumns None 根据列中的当前数据更改当前区域的列宽,以达到最佳宽度。Changes the width of the columns of the current range to achieve the best fit, based on the current data in the columns.
AutofitrowsAutofitrows None 根据列中的当前数据更改当前区域的行高,以达到最佳高度。Changes the height of the rows of the current range to achieve the best fit, based on the current data in the columns.


属性Property 类型Type 说明Description
columnWidthcolumnWidth doubledouble 获取或设置区域内的所有列的宽度。如果列宽不统一,则返回 NULL。Gets or sets the width of all colums within the range. If the column widths are not uniform, null will be returned.
horizontalAlignmenthorizontalAlignment stringstring 表示指定对象的水平对齐方式。可能的值是:GeneralLeftCenterRightFillJustifyCenterAcrossSelectionDistributedRepresents the horizontal alignment for the specified object. Possible values are: General, Left, Center, Right, Fill, Justify, CenterAcrossSelection, Distributed.
rowHeightrowHeight doubledouble 获取或设置区域中所有行的高度。如果行高不统一,则返回 NULL。Gets or sets the height of all rows in the range. If the row heights are not uniform null will be returned.
verticalAlignmentverticalAlignment stringstring 表示指定对象的垂直对齐方式。可能的值是:TopCenterBottomJustifyDistributedRepresents the vertical alignment for the specified object. Possible values are: Top, Center, Bottom, Justify, Distributed.
wrapTextwrapText booleanboolean 指示 Excel 是否将对象中的文本换行。指示整个区域不具有统一换行设置的空值Indicates if Excel wraps the text in the object. A null value indicates that the entire range doesn't have uniform wrap setting


关系Relationship 类型Type 说明Description
bordersborders workbookRangeBorder 集合workbookRangeBorder collection 应用于所选的整个区域的 border 对象的集合。只读。Collection of border objects that apply to the overall range selected Read-only.
fillfill workbookRangeFillworkbookRangeFill 返回在整个区域内定义的 fill 对象。只读。Returns the fill object defined on the overall range. Read-only.
fontfont workbookRangeFontworkbookRangeFont 返回在所选的整个区域内定义的 font 对象。只读。Returns the font object defined on the overall range selected Read-only.
protectionprotection formatProtectionformatProtection 返回某一区域的格式 protection 对象。Returns the format protection object for a range. 只读。Read-only.

JSON 表示形式JSON representation

下面是资源的 JSON 表示形式。Here is a JSON representation of the resource.

  "columnWidth": 1024,
  "horizontalAlignment": "string",
  "rowHeight": 1024,
  "verticalAlignment": "string",
  "wrapText": true