SetUnderline
指定当前范围的内容显示时,字符正下方会出现一条线 (小于行上字符上下方的所有间距)。
语法
expression.SetUnderline(isUnderline);
expression - 表示 ApiRange 类的变量。
参数
| 名称 | 必需/可选 | 数据类型 | 默认值 | 描述 |
|---|---|---|---|---|
| isUnderline | 必需 | boolean | 指定当前范围的内容是否显示下划线。 |
返回值
ApiRange | null
示例
此示例指定当前范围的内容显示时,字符正下方会出现一条线。
// Underline the range.
// Get a range and underline it with one line.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("ONLYOFFICE Document Builder");
let range = doc.GetRange(0, 24);
range.SetUnderline(true);