Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
In Microsoft Word, you can create a form by starting with a template and adding content controls, including checkboxes, text boxes, date pickers, and drop-down lists. In Aspose.Words, a Structured Document Tag or content control from any document loaded into Aspose.Words is imported as a StructuredDocumentTag node. Structured document tags (SDT or content control) allow embedding customer-defined semantics as well as its behaviour and appearance into a document.
StructuredDocumentTag can occur in a document in the following places:
In this version of Aspose.Words, the following types of SDT or content control can be created:
Picture
The following code example shows how to create content control of type checkbox:
The following code example shows how to create content control of type rich text box:
The following code example shows how to create content control of type combo box:
This section explains how to update the values of SDT or content control programmatically.
The following code example shows how to set the current state of the checkbox:
The following code example shows how to modify content controls of type plain text box, drop-down list and picture:
You can bind content controls with XML data (custom XML part) in Word documents.
The following code example shows how to bind content control to custom XML parts:
You can clear the contents of a content control with displaying a placeholder. StructuredDocumentTag.clear() method clears contents of this structured document tag and displays a placeholder if it is defined. However, It is not possible to clear the contents of a content control if it has revisions. If a content control has no placeholder, five spaces are inserted like in MS Word (except repeating sections, repeating section items, groups, check-boxes, citations). If a content control is mapped to custom XML, the referenced XML node is cleared.
The following code example shows how to clear the content of content control:
The StructuredDocumentTag.Color
property allows you to get or set the color of content control. The color affects content control in two situations:
The following code example shows how to change the color of content control:
If you want to set the style of content control, you can use StructuredDocumentTag.Style
or StructuredDocumentTag.StyleName
properties. When you type the text into content control in the output document, the typed text will have the style “Quote”.
The following code example shows how to set the style of content control:
The repeating section content control allows repeating the content contained within it. Using Aspose.Words, the structured document tag nodes of the repeating section and repeating section item types can be created and for this purpose, SdtType enumeration type provides REPEATING_SECTION_ITEM member.
The following code example shows how to bind a repeating section content control to a table:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.