Content controls are individual controls that you can add and customize for use in templates, forms, and documents. These controls are commonly used in MS Word templates and forms and replace the old form fields. Both types of form fields are supported by TX Text Control and will be automatically imported and converted to TX Text Control form fields. Important Only the Office Open XML (DOCX) format, not the MS Word 97-2003 document format, supports content controls in MS Word documents. If you are using fields from other applications, such as MS Word, there are a number of ways to handle these fields. When loading a document, the ApplicationFieldFormat property can be used to specify how a field is imported. There are three relevant options that can be specified when importing fields: None Text fields supported by other applications are not imported as ApplicationFields. Form fields are imported as TX Text Control FormFields. MSWord Fields that are supported and defined by Microsoft Word are imported as ApplicationFields. The ApplicationFieldTypeNames property can be used to select specific types of fields. MSWordTXFormFields Fields that are supported and defined by Microsoft Word are imported as ApplicationFields, with the exception of form fields. Form fields such as combo boxes, check boxes, and form text fields are imported as TX Text Control FormFields. Field Overview The table below shows how fields are imported based on the specified LoadSettings: Field Document Format Imported as ( LoadSettings) None MSWord MSWordTXFormFields TextField InternalUnicodeFormat, InternalFormat TextField N/A N/A MergeField MSWord, WordprocessingML, RichTextFormat × ApplicationField ApplicationField DOCVARIABLE MSWord, WordprocessingML, RichTextFormat × ApplicationField ApplicationField Content Control MSWord, WordprocessingML, RichTextFormat FormFields ApplicationField FormFields Legacy Form Fields MSWord, WordprocessingML, RichTextFormat FormFields ApplicationField FormFields Importing Content Controls Consider the following MS Word document to which several Content Controls have been added. The following code shows how to load the document with Content Control fields automatically converted to TX Text Control fields. TXTextControl.LoadSettings loadSettings = new TXTextControl.LoadSettings() { ApplicationFieldFormat = TXTextControl.ApplicationFieldFormat.MSWordTXFormFields }; using (TXTextControl.ServerTextControl serverTextControl = new TXTextControl.ServerTextControl()) { serverTextControl.Create(); serverTextControl.Load("contentcontrols.docx", TXTextControl.StreamType.WordprocessingML, loadSettings); foreach (FormField ff in serverTextControl.FormFields) { Console.WriteLine(ff.Text); } } When the document is loaded into a visual TX Text Control, the Content Control fields are rendered as form fields by default. Processing Content Controls Another way to access Content Controls is to import the document without converting them to form fields. In this case, Content Controls are accessible through the ApplicationFields collection to provide more access to the contained data. The DocumentServer includes the Fields namespace, which contains field classes for retrieving additional data from Content Controls such as Title or Tag. The following code shows how to access the Content Controls in the document. LoadSettings ls = new LoadSettings() { ApplicationFieldFormat = ApplicationFieldFormat.MSWord }; using (ServerTextControl tx = new ServerTextControl()) { tx.Create(); tx.Load("contentcontrols.docx", StreamType.WordprocessingML, ls); foreach (ApplicationField af in tx.ApplicationFields) { try { var tempField = ContentControlFieldAdapter.CreateContentControl(af); if (tempField is RichTextContentControl || tempField is PlainTextContentControl || tempField is CheckBoxContentControl || tempField is ComboBoxContentControl || tempField is DateContentControl || tempField is DropDownListContentControl) { Console.WriteLine(tempField.Title); } } catch (Exception ex) { Console.WriteLine(ex.Message); } } } Conclusion Content controls are used to create structured documents and forms. This article showed how to import and process content controls in MS Word documents using TX Text Control. TX Text Control supports legacy form fields, merge fields, and Content Control fields, making them easy to import and edit.