跳到主要内容

CreateBullet

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

语法

expression.CreateBullet(sSymbol);

expression - 表示 Api 类的变量。

参数

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

返回值

ApiBullet

示例

此示例演示如何创建项目符号。

// How to add a bullet to the paragraph.

// Add bulleted paragraph.

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();

const fill = Api.CreateSolidFill(Api.RGB(255, 111, 61));
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const shape = Api.CreateShape("flowChartMagneticTape", 300 * 36000, 130 * 36000, fill, stroke);
shape.SetPosition(608400, 1267200);
const docContent = shape.GetDocContent();
const paragraph = docContent.GetElement(0);
const bullet = Api.CreateBullet("-");
paragraph.SetBullet(bullet);
paragraph.AddText(" This is an example of the bulleted paragraph.");
slide.AddObject(shape);