SetHighlight
function SetHighlight(sColor: highlightColor = null): ApiTextPr
Description
Specifies a highlighting color which is applied as a background to the contents of the current run.
Parameters
Available highlight color.
Returns
ApiTextPr
Overloads
- SetHighlight
(sColor)
Specifies a highlighting color which is added to the text properties and applied as a background to the contents of the current run/range/paragraph.
Try It
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oRun = Api.CreateRun();
oRun.AddText("This is just a sample text. ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.SetHighlight("lightGray");
oRun.AddText("This is a text run with the text highlighted with light gray color.");
oParagraph.AddElement(oRun);