跳到主要内容

SetControlsHighlight

Sets the highlight to the content controls from the current document.

Syntax

expression.SetControlsHighlight(r, g, b, bNone);

expression - A variable that represents a ApiDocument class.

Parameters

NameRequired/OptionalData typeDefaultDescription
rRequiredbyteRed color component value.
gRequiredbyteGreen color component value.
bRequiredbyteBlue color component value.
bNoneOptionalbooleanfalseDefines that highlight will not be set.

Returns

boolean

Example

This example sets the highlight to the content controls from the document.

// How to highlight thw controls with rose color.

// Add elements to the document and color their background.

let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
blockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control.");
doc.AddElement(0, blockLvlSdt);
doc.SetControlsHighlight(255, 111, 61);