跳到主要内容

CreateBullet

使用 sSymbol 参数指定的字符或符号为段落创建项目符号。

语法​

expression.CreateBullet(sSymbol);

expression - 表示 Api 类的变量。

参数​

名称必需/可选数据类型默认值描述
sSymbol必需string将用于为段落创建项目符号的字符或符号。

返回值​

ApiBullet

示例​

创建短划线项目符号并将其应用于电子表格中形状内的段落。

// How do I add a custom bullet symbol to a paragraph in a spreadsheet?

// Mark a paragraph with a bullet character to create a list item in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let fill = Api.CreateSolidFill(Api.RGB(255, 111, 61));
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let shape = worksheet.AddShape("flowChartOnlineStorage", 120 * 36000, 35 * 36000, fill, stroke, 0, 2 * 36000, 0, 3 * 36000);
let docContent = shape.GetContent();
let paragraph = docContent.GetElement(0);
let bullet = Api.CreateBullet("-");
paragraph.SetBullet(bullet);
paragraph.AddText(" This is an example of the bulleted paragraph.");