Clear

Clear()

Clears a list of values of the combo box / dropdown list content control.

Parameters:

This method doesn't have any parameters.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
Api.pluginMethod_AddContentControlList(1, [{Display: "Item1_D", Value: "Item1_V"}, {Display: "Item2_D", Value: "Item2_V"}], {"Id": 100, "Tag": "CC_Tag", "Lock": 3});
var aContentControls = oDocument.GetAllContentControls();
var oContentControlList = aContentControls[0].GetDropdownList();
oContentControlList.Clear();
oDocument.AddElement(0, oContentControlList);
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("All the items were deleted from the combo box.");
oDocument.Push(oParagraph);
builder.SaveFile("docx", "Clear.docx");
builder.CloseFile();

Resulting document