跳到主要内容

GetBodyShapeText

返回当前备注页正文形状中的文本。

语法

expression.GetBodyShapeText();

expression - 表示 ApiNotesPage 类的变量。

参数

此方法没有任何参数。

返回值

string

示例

从演示文稿中备注页的正文形状获取文本。

// How do I get the body shape text in a presentation?

// Get the body shape text using a notes page object.

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

const notesPage = slide.GetNotesPage();
notesPage.AddBodyShapeText('This text was added using AddBodyShapeText method to notes page of the first slide');

const fill = Api.CreateSolidFill(Api.CreateRGBColor(100, 150, 200));
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const shape = Api.CreateShape('rect', 300 * 36000, 150 * 36000, fill, stroke);
slide.AddObject(shape);

const text = notesPage.GetBodyShapeText();
const paragraph = shape.GetContent().GetElement(0);
paragraph.AddText(text);