Although it's true that you can use Microsoft Office Word to create a document that looks and feels like a form, Word works best as a word-processing program, not a form-designing program. Conversely, Microsoft Office InfoPath was created specifically for designing and filling out electronic forms. If you want to convert existing Word documents into InfoPath form templates, you can use the Import Wizard in InfoPath to do so. You can then take advantage of dedicated InfoPath features for designing, publishing, and filling out forms. For example, in a sales report form template, you can use conditional formatting to automatically apply a red background color when numbers dip below sales projections. In the same form template, you can use a rule to enable forms based on that form template to be submitted as an attachment in an e-mail message when someone clicks a submit button. In addition, you can make your form template available to a wider audience by creating a browser-enabled form template.
When you convert a Word document to an InfoPath form template, the resulting form template will closely match the layout of the Word document. In addition, items in the Word document that meet certain conditions are automatically converted to the appropriate controls that users can enter data into. For example, if the Word document contains brackets surrounding multiple spaces, InfoPath assumes that you used that bracketed area as a text-entry field and converts it to a text box control in the resulting form template. Any Word form fields are converted to the corresponding controls in InfoPath.
You can use the settings in the Import Options dialog box to change the options for converting a Word document to an InfoPath form template.
This article explains the basic concept and procedure for converting a Word document to an InfoPath form template, including the features and settings that are not supported in the conversion process.
In this article
About converting a Word document to an InfoPath form template
When you convert a Word document to an InfoPath form template, the document is used like a blueprint to create a new form template. The basic structure of the document is recreated as closely as possible in the form template. In a Word document, a "form field" is the location where a particular type of data, such as a name or address, is stored. If you choose to include Word form fields when you convert the document, text box, check box, and drop-down list box controls are added to the InfoPath form template at a location that corresponds to the location of the fields in the Word document. In addition, InfoPath automatically detects the parts of the Word document that might work well as repeating tables and rich text boxes, and converts them to the appropriate controls. For example, if an expense report document includes a blank, underlined area in which users can type notes about a particular expense, InfoPath will convert that area into a rich text box. Users can then type multiple lines of text in the rich text box, and format that text as appropriate.
To better understand the relationship between a Word document that you convert by using the InfoPath Import Wizard and the resulting InfoPath form template, imagine that for the past several years your organization has used a Word document called ExpenseReport.doc to collect expense report data from employees. Your IT department wants to convert that document to an InfoPath form template so that form data can be submitted as Extensible Markup Language (XML) to an Accounts Payable system.
If you use the Import Wizard to convert ExpenseReport.doc to a form template, InfoPath creates a form template called ExpenseReport.xsn. In the following example, the Expense Details table in the Word document has been converted into a repeating table in the resulting InfoPath form template. The repeating table enables users to insert or remove expenses as necessary by clicking commands on a shortcut menu.
When the Word document is converted to an InfoPath form template, the layout and other elements are preserved. By default, the number of empty rows in the InfoPath repeating table matches the number of empty rows in the Word table. However, you can save space on your form template by displaying just one or two rows by default.
This new form template contains elements that are similar to those found in the Word document, such as the table for collecting expense information. However, depending on the settings that you choose in the Import Wizard, some features may differ in the resulting form template:
-
If you use the Import Wizard to import the Word document by preserving the layout only The resulting form template contains a repeating table for entering line items in the expense report. However, any form fields from the original document, such as the Name text box, Department drop-down list, and Division check boxes, are discarded from the resulting form template.
-
If you use the Import Wizard to import the Word document both by preserving the layout and by converting Word form fields to controls (default) The resulting form template contains a repeating table for entering line items in the expense report. Any form fields from the original document, such as the Name text box, Department drop-down list, and Division check boxes, are converted to the corresponding InfoPath controls.
-
If you use the Import Wizard to import the Word document both by preserving the layout and by converting form fields to controls (custom) You can decide exactly which fields get converted when you import the expense report. For example, you can disable the option for converting empty table cells in the document to text boxes in the resulting form template.
Word features and settings that are not fully supported during conversion
Some settings and formatting in Word documents are not supported in InfoPath form templates. When you convert a Word document that contains such settings, the resulting form template will not contain those features or settings. For example, if your Word document has revision marks, the revision marks will be discarded in the resulting form template because InfoPath does not support this feature.
You can use the Design Checker task pane in design mode to discover any problems with the conversion. You can then take action to correct those problems.
The following is a list of features and settings that are not preserved when you convert a Word document to an InfoPath form template. In some cases, formatting is discarded but the underlying text is preserved. For example, if you have newsletter-style columns, InfoPath will discard the columns, but import the text contained in those columns.
-
Bookmarks
-
Animated text
-
Themes
-
Watermarks
-
Line numbering
-
Page borders
-
Footnotes and endnotes
-
Newsletter-style column layouts
-
File attachments
-
Linked or embedded objects, such as Microsoft Office Excel worksheets and Microsoft Office Visio drawings
-
Drawing objects (including AutoShapes, curves, lines, and WordArt)
-
Character spacing (including scaling, expanded or condensed spacing, raised or lowered positioning of text, and kerning for fonts)
-
ActiveX controls
-
Comments and tracked changes (including insertions, deletions, and formatting changes)
-
Some features that are specific to Microsoft Office Word 2007 (including building blocks and content controls)
-
Some print settings (including mixed character formatting in headers and footers, different odd and even headers and footers, different headers and footers for first page, gutter settings, negative values for top and bottom margins, different page orientations, and individual section settings)
Note: Some Word documents cannot be modified without a password. If this is the case with your document, you may not be able to successfully import it into InfoPath. To fix the problem, try removing the password protection from the document before you import it. In addition, some documents restrict users to certain types of editing actions, such as entering data in form fields. If this is the case with your document, you may not be able to successfully import it into InfoPath. To fix this problem, try removing the editing restrictions for your document before you import it.
The following list explains the features and settings that are partially supported when you convert a Word document to an InfoPath form template:
Vertical text InfoPath retains vertical text formatting in a Word document if the vertical text is found inside of a table cell. InfoPath discards vertical text formatting when converting a Word document if the vertical text is found outside of a table cell, in another part of the Word document.
Text boxes In Word documents, text boxes are containers for text that can be positioned on a page and sized. If the Word document contains a text box, that text box will be converted to a table cell in the resulting form template. Any text in the text box will appear in the table cell in the resulting form template.
Underlined text Underlining is supported in InfoPath form templates. However, any decorative or double underlines in the Word document are converted to single underlines in the resulting form template.
Hyperlinks that reference unsupported protocols All hyperlinks are converted, but if the hyperlink uses a protocol other than HTTP, HTTPS, FILE, FTP, or MAILTO, the hyperlink will not work when a user clicks the link in the resulting form template.
Character styles and text effects Superscript, subscript, and single strikethrough formatting styles are preserved during the conversion process. Other formatting styles and effects, including outlined text, hidden text, and shadow formatting, are discarded during the conversion process. Embossed or engraved text is converted to gray text in the resulting form template.
Section settings In Word, sections are used to vary the layout for a document within a page or between pages. InfoPath does not support these types of sections, which are discarded during the conversion process. Any settings that are applied to the first section in the Word document are applied to the resulting InfoPath form template.
Header and footer formatting Header and footer text in the Word document will be converted to header and footer text in the resulting InfoPath form template. Some character formatting may be discarded during the conversion process. For example, if you used both bold and italic formatting in the header of a Word document, InfoPath will use the first formatting style it encounters in the resulting form template and discard the remaining formatting. Similarly, any settings that are applied to the first header or footer section in the Word document are applied to the resulting header or footer text in the InfoPath form template.
Font conversion Although InfoPath imports the fonts from a Word document when creating a new form template, if the fonts in the document are not available on the computer where you perform the import, alternate fonts will automatically be selected for the form template.
Negative page margins Negative top and bottom margins will be imported as 0.
Negative margin, padding, and indent settings Negative margin, padding, and indent settings will be imported as 0.
Convert a Word document to an InfoPath form template
-
If the Word document you want to import is open, close it.
-
In design mode, on the File menu, click Import Form.
-
In the Import Wizard, click InfoPath importer for Word documents, and then click Next.
-
Click Browse.
-
Locate and click the Word document that you want to convert, and then click Open.
Note: If you are importing a Word document with restricted permission, you must have Full Control access to the document. If you have only Read or Change access to the document, you will see an error message when you try to import it.
-
To change the default import behavior, click Options, and then select the options that you want.
-
Click Finish.
Change a layout table to a repeating table
If your Word document includes a table, InfoPath may convert it into a layout table or a repeating table in the resulting form template. The type of table chosen depends on the design decisions you made in the Word document. You can use the following procedure to quickly change a converted layout table to a repeating table.
You can use repeating tables to offer your users an extra degree of flexibility when filling out forms. When you use repeating tables, your form template doesn't have to show numerous blank rows when the user first opens it. Instead, users typically see just one row and only add more when and if they need them. This saves space in the form and offers users an extra degree of personalization.
-
In the form template, right-click anywhere inside of the layout table that you want to convert.
-
On the shortcut menu, point to Change To, and then click Repeating Table.
-
In the Change To Repeating Table dialog box, do one or more of the following:
-
To specify the header rows for the repeating table, enter a value in the Number of rows to keep as a table header box. You typically use the header row for column headings.
-
To specify the footer rows for the repeating table, enter a value in the Number of rows to keep as a table footer box. Many tables do not include footer rows.
-
To specify the number of data rows to use, enter a value in the Number of repeating rows to include while filling out the form box. The data row is a row that can "repeat" in the form as many times as necessary
-
-
On the Insert menu, click More Controls, or press ALT+I, C.
-
Insert the controls that you want in the table cells.
Change check boxes to a group of option buttons
If you used multiple check boxes in your Word document, InfoPath imports them as check boxes in the resulting InfoPath form template. If you would rather use a group of option buttons, follow the steps below to convert the check boxes into option buttons in your form template.
You can use a group of option buttons on a Microsoft Office InfoPath form template when you want users to be able to make just one selection from a limited set of options.
-
In the form template, click one of the check boxes that you want to convert, and then hold down CTRL and click each additional check box that you want to convert.
-
On the Edit menu, point to Change To, and then click Option Button.
A group of option buttons now appears in place of the check boxes in your form template. Each option button is bound to the same field in the data source. When a user clicks an option button, the value that is associated with that option button is stored in the field.
Review conversion problems in the Design Checker task pane
Sometimes, elements from the original Word document either don't appear as expected in the resulting InfoPath form template or are removed during the conversion process. For example, InfoPath does not support the Word WordArt feature and replaces WordArt objects with placeholder images in the resulting form template.
If InfoPath detects problems during the conversion process, the Design Checker task pane opens automatically after you close the Import Wizard. In the task pane, you can review a list of the problems and take the necessary steps to fix them.
-
If the Design Checker task pane isn't visible, click Design Checker on the Tools menu.
If there are any problems with the form template, you will see messages in the task pane.
-
In the Design Checker task pane, click the text of the message that you want to review.
A dialog box displays additional information about the problem.
Note: If the Word document contains an object that InfoPath does not support, such as a Word drawing object, then InfoPath adds a placeholder image to the resulting form template, indicating where the object was originally located in the Word document. To find out more about the object, right-click the placeholder image on the form template, and then click More Details on the shortcut menu.
-
Fix the problems in the form template, if necessary. For example, you may want to delete any placeholder images, which aren't intended to be used in the completed form template.
Note: You may notice that the Design Checker task pane contains a Refresh button. Clicking the Refresh button won't update messages that appear as a result of importing a Word document into InfoPath. If you want to remove import messages from the Design Checker task pane, you must open the Resource Files dialog box (Tools menu), and then remove the file named ImportErrors.xml. This file is created automatically when you import a Word document into InfoPath. After you remove the ImportErrors.xml file, click Refresh in the Design Checker task pane to permanently delete the import messages. The ImportErrors.xml file isn't required for the form template to function properly. In fact, for security reasons, it is good practice to remove this file before publishing your form template.