跳到主要内容

SetShd

指定应用于段落内容的底纹。

语法

expression.SetShd(type, color);

expression - 表示 ApiParagraph 类的变量。

参数

名称必需/可选数据类型默认值描述
type必需ShdType将应用于当前段落内容的底纹类型。
color必需ApiColor用于填充底纹的颜色或图案。

返回值

boolean

示例

此示例指定应用于段落内容的底纹。

// How to add shading to the paragraph.

// Apply the clear shading to the paragraph.

let doc = Api.GetDocument();

let myStyle = doc.CreateStyle('My document style');
let paraPr = myStyle.GetParaPr();
paraPr.SetShd('clear', Api.RGB(255, 111, 61));

let paragraph = doc.GetElement(0);
paragraph.AddText('This is an example of setting a shading to a paragraph.');
paragraph.SetStyle(myStyle);