您可以选择单个度量单位来指定工作簿的各种距离值(如列宽、行高和页边距)。为此,请设置 Workbook.Unit
属性。
在以下情况下,将使用 Unit 属性指定的工作簿度量单位。
计量单位 | 中文说明 | 描述 | 如何使用 |
Document | 文档 | 文档(1 个文档单位等于 1/300 英寸)。这是工作簿的默认度量单位。 | 将 Unit 属性设置为 DocumentUnit.Document. |
Centimeter | 厘米 | 厘米 (1 英寸 等于 2.54 厘米) | 将 Unit 属性设置为 DocumentUnit.Centimeter |
Millimeter | 毫米 | 毫米(10 毫米等于 1 厘米) | 将 Unit 属性设置为 DocumentUnit.Millimeter |
Inch | 英寸 | 英寸 | 将 Unit 属性设置为 DocumentUnit.Inch |
Point | 点 | 点(1 英寸等于 72 点) | 将 Unit 属性设置为 DocumentUnit.Point |
Pixel | 像素 | 像素(1 英寸等于 96 像素)。您可以使用本机设置列宽。 | 使用以下属性设置列宽(以像素为单位)。 |
Worksheet.DefaultColumnWidthInPixels | |||
Column.WidthInPixels | |||
Character | 字符 | 字符(内置 Normal 样式指定的字体中零字符的宽度)。您可以使用本机设置列宽。 | 使用以下属性设置列宽(以字符为单位)。 |
Worksheet.DefaultColumnWidthInCharacters | |||
CellRange.ColumnWidthInCharacters | |||
Column.WidthInCharacters |
通过 Worksheet.DefaultColumnWidth、CellRange.ColumnWidth 或
Column.Width 属性指定列宽时。
通过 Worksheet.DefaultRowHeight、CellRange.RowHeight 或
Row.Height 属性指定行高时。
通过 Margins 对象的属性指定页边距时。