Aspose::Words::Fields::TextFormFieldType enum

TextFormFieldType enum

Specifies the type of a text form field.

enum class TextFormFieldType : int

Values

NameValueDescription
Calculated5The text form field value is calculated from the expression specified in the TextInputDefault property.
CurrentDate3The text form field value is the current date when the field is updated.
CurrentTime4The text form field value is the current time when the field is updated.
Date2The text form field can contain only a valid date value.
Number1The text form field can contain only numbers.
Regular0The text form field can contain any text.

Examples

Shows how to create form fields.

auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>();

// Form fields are objects in the document that the user can interact with by being prompted to enter values.
// We can create them using a document builder, and below are two ways of doing so.
// 1 -  Basic text input:
builder->InsertTextInput(u"My text input", TextFormFieldType::Regular, u"", u"Enter your name here", 30);

// 2 -  Combo box with prompt text, and a range of possible values:
System::ArrayPtr<System::String> items = System::MakeArray<System::String>({u"-- Select your favorite footwear --", u"Sneakers", u"Oxfords", u"Flip-flops", u"Other"});

builder->InsertParagraph();
builder->InsertComboBox(u"My combo box", items, 0);

builder->get_Document()->Save(get_ArtifactsDir() + u"DocumentBuilder.CreateForm.docx");

See Also