If you do need to allow the user to format text in a data entry control, the Rich Text Box object would be a much better choice than the Text Box object. Using the Rich Text Box object, you can give users a way to enter and format their own text, and the formatting will be retained and stored in the back-end data source or XML file, including fonts, tables, graphics, and so on.
When you add a Rich Text Box object to a form from the Controls view of the Task Pane or your own Data Source, it will default to approximately 540 pixels wide by 50 pixels high, similar to the box shown here.
You can change the size and appearance of a Rich Text Box object by using some of the common formatting techniques reviewed earlier in this chapter. By default, a Rich Text Box object can be used to enter formatting text, tables, horizontal lines, pictures, and so on, and is ready to use without any additional formatting required.
Tip | For a review of how to use Rich Text Box objects to enter data, flip back to Chapter 3, which looked at InfoPath from the end-user’s perspective. |
If you want to limit what users can enter into a Rich Text Box, you have some control over what can be entered through the object’s property pages. To access these pages, right-click your object and select Properties from the right-click menu to open the Rich Text Box Properties dialog box. Click the Display property page, shown in Figure 6-8.
Figure 6-8: Rich Text Box object display settings
Under the Available Formatting section, you can select what elements a user is able to use when entering text into a Rich Text Box, including
Paragraph Breaks
Character Formatting
Full Rich Text (images, tables, and so on)
You can select these options independently without affecting the other formatting options—if you don’t want users to be able to add larger images, tables, and so on, you can turn off the option for Full Rich Text, which will then limit users to entering only formatted text.
In the Options section, you have some of the same formatting options that are available for plain text boxes, including the options to make the field read-only, enable spell-checking, enable text wrapping, and so forth, but there are not a lot of other options available for rich text boxes, because the user will be doing the majority of the formatting.