How to: Share InfoPath 2007 Template Parts

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Summary: Learn how to create and share InfoPath 2007 template parts and use them in multiple form templates to shorten design time and provide consistency in an enterprise environment. (3 printed pages)

Microsoft Corporation

April 2007

**Applies to:**Microsoft Office InfoPath 2007

Contents

  • Template Parts Overview

  • Creating and Sharing Template Parts

  • Additional Resources

Template Parts Overview

Form template designers who use Microsoft Office InfoPath 2007 can create and use reusable template parts. Template parts can include the following:

  • Controls.

  • A data source, defined with the Office InfoPath 2007 form template designer user interface (UI) or by referencing an XML document (.xml) file or XML schema (.xsd) file.

  • Declarative business logic, such as data validation and rules.

  • Data connections.

You can use these template parts in multiple form templates to shorten design time and provide consistency in an enterprise environment.

Creating and Sharing Template Parts

First, you must create a registry key to specify the location of a repository of controls on the network that Office InfoPath 2007 uses to populate the Custom section of the Controls task pane in the form template design environment. The specified location contains the template parts and ActiveX controls you want to share with other form template designers.

To create the registry key

  1. Click Start, click Run, and then type regedit to open Registry Editor.

  2. Browse to the following location in the registry:

    HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\InfoPath\Designer

  3. On the Edit menu, click New, and then click String Value to create a new value for the Designer key.

  4. For the new Value name, type IPCustomControlsFolder.

  5. For the Value data of the new string value, type a location where the template part (.xtp) files are located.

    This can be a UNC value, such as "\\ServerName\InfoPathTemplateParts," or a mapped drive location, such as "Z:\InfoPathTemplateParts."

When the designer UI of Office InfoPath 2007 is reopened, all template parts and ActiveX controls at the network location are displayed in the Custom section of the Controls task pane.

NoteNote

Each Office InfoPath 2007 computer in the enterprise must have this registry value present to list the template parts located on the network. If the network location is unavailable, InfoPath 2007 will start, but the network template parts will not be available on the Controls task pane.

After you specify the network location for the template parts you want to share, create a sample template part and save it to that location.

To create a sample template part

  1. On the File menu, click Design a Form Template.

  2. In the Design a Form Template dialog box, under Design a new, click Template Part.

  3. In the Based on gallery, do one of the following:

    • To define the data source as you design the template part, click Blank.

    • To use an XML document (.xml) file or an XML Schema (.xsd) file as the data source for the template part, click XML or Schema.

    NoteNote

    If you base your template part on an XML document or XML Schema, InfoPath 2007 populates the Data Source task pane with fields and groups that map to XML elements in the document or schema. The data source is locked. Depending on the document or schema, you might not be able to add new fields or groups to the data source, or to change certain aspects of existing fields and groups.

  4. To make your template part compatible with InfoPath Forms Services, select the Enable browser-compatible features only check box.

  5. Click OK.

    A new template part opens in Office InfoPath 2007.

  6. Design your template part, adding layout and control elements as necessary.

    When you finish designing the template part, on the File menu, click Save. To make the template part available on the network, either save it directly to the network location or copy the template part (.xtp) file to the network location.

    NoteNote

    You can restrict users from adding template parts to the Controls task pane and inserting template parts into form templates. For more information, see the Office Resource Kit documentation.

Additional Resources

Design a template part to reuse in multiple form templates

Change an existing template part

InfoPath Developer Portal