14.3. Setting Properties for Content Controls Word's new content controls are remarkably powerful tools, especially when you combine them with the XML features that are built into Word's new file formats. You determine how a control looks and acts by editing its properties. If you used Visual Basic for Applications (VBA) in previous versions of Word, you're probably familiar with fine-tuning a control's properties, but you may be surprised when you open the Properties box for one of the new content controls. You find fewer properties, and most of the settings won't look familiar. Microsoft is phasing out the old controls, in part, for security reasons. Earlier versions of Visual Basic for Applications combined with ActiveX controls were a playground for the folks who create computer viruses and other nasties. (If necessary, you can still insert the old VBA-style tools on the Legacy Tools menu.) The new content controls also work seamlessly with XML codewhich is a new standard for documents and exchanging information. This arrangement makes it easy for another computer system to read the information collected in your form. One of the best things about controls is that you can lock them (using two checkboxes in the Properties box) to prevent people from deleting them or editing the contents. In addition, each content control has its own specific properties. For example, the Date Picker control lets you specify a display format to show dates such as 10/1/2006; Sunday, October 1, 2006; and just about every variation in between. For the plain text control, you have an "Allow carriage returns (multiple paragraphs)" option, as a way to let readers create multiple paragraphs within a single text box. To open the Properties box for a content control, switch to Design Mode (Developer Controls Design Mode). Select the control, and then go to Developer Controls Properties. The Content Control Properties box opens. Different controls have different properties that you can tweak. Heres a quick rundown: -
The Title appears in your document on the content control's tab. If you don't give your content control a name , Word leaves the taband the Title fieldblank. -
The Tag may sound like just another name to you, but it's important to computer programs. They use the Tag to identify and then read or write to the contents in your control. -
Use the Content control cannot be deleted box to keep people from deleting the controls in your form when they fill in the information. -
Use the Content control cannot be edited if you don't want people to change the contents of the control. It's unlikely you'd use this for a form, but for other types of documents, you may want to show someone information in a control without letting them change it. -
Use the Allow carriage returns (multiple paragraphs) box to permit people to put several paragraphs in a Text control. -
Turn on Remove content control when contents are edited to create prompts in your documents. After someone types in text, the content control disappears, and the text takes its place in the document. -
Both the Combo Box and the Drop-Down List have Drop-Down List Properties where you provide words and options for the lists. -
The Date Picker has several unique properties including Display the date like this where you choose the format for the date (12/25/2006; Monday, October 1, 2006; and so on). Locale and Calendar type are also used to control the way dates are shown in different regions and languages. The Store XML contents in the following format when mapped option is used to communicate date information to other programs. -
The Building Block Gallery control uses Gallery and Category properties to select specific building blocks that can be inserted in the document. The following table has a complete list of the available properties for each control. Table 14-1. Content Control Property: | Rich Text | Text | Picture | Combo Box | Drop-Down List | Date Picker | Building Block Gallery | Title | | | | | | | | Tag | | | | | | | | Use a style to format contents | | | | | | | | Content control cannot be deleted | | | | | | | | Contents cannot be edited | | | | | | | | Allow carriage returns (multiple paragraphs) | | | | | | | | Remove content control when contents are edited | | | | | | | | Drop-Down List Properties | | | | | | | | Display the date like this | | | | | | | | Locale | | | | | | | | Calendar type | | | | | | | | Store XML content in the following format when mapped | | | | | | | | Gallery | | | | | | | | Category | | | | | | | | |