Skip to main content

SetHighlight

Specifies a highlighting color which is applied as a background to the contents of the current paragraph.

Syntax

expression.SetHighlight(sColor);

expression - A variable that represents a ApiParagraph class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sColorRequiredhighlightColorAvailable highlight color.

Returns

ApiParagraph

Example

This example sets highlight color "lightGray" for the paragraph.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("This is a paragraph with the text highlighted with light gray color.");
paragraph.SetHighlight("lightGray");