SetText
Sets the text to the current combo box.
Available only for editable combo box forms.
Parameters:
Name |
Type |
Description |
sText |
string
|
The combo box text. |
Returns:
- Type
-
boolean
Example
Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oComboBoxForm = Api.CreateComboBoxForm({"key": "Personal information", "tip": "Choose your country", "required": true, "placeholder": "Country", "editable": true, "autoFit": false, "items": ["Latvia", "USA", "UK"]});
var oParagraph = oDocument.GetElement(0);
oParagraph.AddElement(oComboBoxForm);
oComboBoxForm.SetText("France");
builder.SaveFile("docx", "SetText.docx");
builder.CloseFile();
Resulting document