Form Field with HTML text

Hi,

Is there a way I could create a FormField in a Word Document and load the field with HTML input text?

Thanks

Hello

Thanks for your request. Please see the following link to learn how to inset FormField into the document and set text:
https://reference.aspose.com/words/net/aspose.words/documentbuilder/inserttextinput/

Please let me know in case of any issues. I will be glad to help you.

Best regards,

Andrey,

Thanks for the quick response. However, the problem I am having is that the "fieldValue " parameter

could be something like “This is text inserted by InsertHtml” and I would like the “InsertHtml” text in the parameter to be displayed as “BOLD” (in the formfield) and not get converted to html text.

public FormField InsertTextInput(
string name,
TextFormFieldType type,
string format,
string fieldValue,
int maxLength);

Hi there,

Thanks for your inquiry.

Please try using the code below to insert content via InsertHtml into the result of a FormField.

FormField formField = builder.InsertTextInput("MyFormField", TextFormFieldType.Regular, "", "", 100);
// Move to the field end of the FormField
builder.MoveTo(formField.NextSibling.NextSibling);
builder.InsertHtml("**Formatted Text**");

Thanks,