When you design a new form in Microsoft Office InfoPath 2003, you're actually creating a form template (form template: In InfoPath, a file or set of files that defines the data structure, appearance, and behavior of a form.). After you finish designing the form template, you must publish it so that your users can fill out forms based on that form template. Forms can be published to a shared folder on a computer, to a form library (form library: A folder in which a collection of forms based on the same template is stored and shared. Each form in a form library is associated with user-defined information that is displayed in the content listing for that library.) on a Microsoft Windows SharePoint Services Web site, or to a Web server. In all of these cases, your users must have access to the location where you publish the form template. Forms can also be sent to users in an e-mail message.
This topic covers the InfoPath publishing model, including some common questions about InfoPath publishing, such as whether users must have InfoPath in order to fill out forms.
How publishing works
When you publish a form template, you use the Publishing Wizard in InfoPath to save the form template to a set location and make it available for your users to fill out. The Publishing Wizard leads you through the following steps:
- Choosing whether you want to publish the form template to a shared folder, SharePoint site, or Web server.
- Specifying the location of the folder, SharePoint site, or Web server.
- Specifying the access path that your users will need in order to fill out forms based on that form template.
- Notifying your users in an e-mail message that the form is available for them to fill out.
If you are publishing your form to a SharePoint site, the Publishing Wizard also asks you to specify the name and description of the form library on the site,
in addition to selecting the form data that you want to display as columns in the form library.
When a user wants to fill out a form for the first time, he or she goes to the location where the form template was published and opens it. The form template creates a new instance of the form for the user to fill out.
When a user opens the new form, InfoPath also stores (or caches) the form template on the user's computer. This allows the user to fill out the form even when offline. If the user opens the same form later, InfoPath determines whether the user's computer is connected to the published location of the form template. If there is a connection, InfoPath checks for any updates to the form template, applies those updates, and then opens the form. If there is no connection, InfoPath opens the form based on the form template that is stored on the user's computer.
As a form designer, you need to be aware that publishing
a form is not the same as saving it. Publishing a form creates an access path so that your users can locate the form.
This access path is often different from the location to which you save the form when you design it. For example, when designing your form, you might publish it to a folder on your local drive, such as <drive>:\Folder\Form.xsn, but use an access path that includes the name of your computer, such as \\Samplename\Folder\Form.xsn. When you publish the form, the Publishing Wizard allows you to specify both the location where the form is published
and the access path for the form.
Technical details
Each time a form is filled out, InfoPath includes processing instructions
that point to the associated form template. The processing instructions look like the following:
href="file:///\\servername\foldername\exampleform.xsn"
To see what the processing instructions look like in one of your forms, open it in a text editor, such as Microsoft Notepad, and look for the href attribute at the beginning of the file.
Whenever you work on a form template in design mode (design mode: The InfoPath design environment in which you can create or modify a form template.), you have four choices for saving or publishing that form template: Save, Save As, Publish, and Extract Form Files. Each of these actions has a different purpose, as shown in the following table.
| Command | Description | When to use |
|---|
| Save | Saves the form template to its current location, using the same name. If you are modifying a form template that has already been published, saving will update the published form template. | Use this command to save your changes when designing a published or unpublished form template. |
| Save As | Saves the form template to a new location or with a new name. If you are modifying a form template that has already been published, using Save As will not update the published form template. | Use this command when you need to modify a copy of a form template. |
| Publish | Saves the form template and publishes it to a new location or with a new name. Publishing the form template also creates an access path so users can fill out forms based on the form template. | Use this command when you are ready for users to fill out forms based on your form template or when you want to change the location of a
published form template. |
| Extract Form Files | Saves the form template to a new location, as a set of form files (form files: A collection of files that are used to implement an InfoPath form. File types can include .html, .xml, .xsd, .xslt, script, and other file types that are necessary to support the functionality of the form.), instead of as a single .xsn file. | Use this command when you need to modify the form template's individual form files. |
Regardless of where and how you publish a form template, your users must have InfoPath installed on their computers before they can fill out an InfoPath form. If you need to allow users without InfoPath to fill out a form, you can create a Web form version of an InfoPath form by using Microsoft ASP.NET. The Web form will not support the rich features found in InfoPath, including offline use, data validation (data validation: The process of testing the accuracy of data; a set of rules you can apply to a control to specify the type and range of data that users can enter.), the spelling checker, and rich-text formatting.
Modifying or moving a published form template
If you update a form template, the changes you make will be reflected in any existing forms that are associated with that form template. For example, if you delete a section in your form template that contains a table, that table and all of the data in the table will be deleted in all of the existing forms based on that form template.
To modify a form template without overwriting the published form template, open the published form template and use the Save As command to save a copy of the form template. After modifying and updating the copy of the form template, you can publish it to the original location where it was published. Because InfoPath determines the identity of a form template based on its
name and location, it is important not to change these when you republish the form template.
If you want to update the location of a published form template, open it in InfoPath, and then republish the form template to the new location. If you do not use InfoPath when you move a published form template to a new location, you can cause errors that prevent users from opening new or existing forms based on that template.
Sending a form in an e-mail message
You can also use Microsoft Office Outlook 2003 to send a form to others as an attachment to an e-mail message. Recipients can then use InfoPath to open the attachment and either fill out the form or edit the form's design.
Before you send a form to others, it is recommended that you publish the form to a location that is accessible to users of the form. This enables you to update the form more easily and allows certain features to work correctly, including data connections (data connection: The connection between an InfoPath form and an external data source, such as a database, Web service, SharePoint library, or XML file. Data connections are used to query and submit data.), custom task panes (custom task pane: An .html file whose content is displayed in a window next to a form. Custom task panes can provide form-specific commands and Help content.), Microsoft ActiveX controls (ActiveX control: A custom control. Form designers can add or remove ActiveX controls in the Controls task pane.), and managed code. If you prefer to send the form without publishing it to a shared location, you can digitally sign the form and mark it as fully trusted. This enables form features to work correctly and allows you to send updated versions of the form to others by using an e-mail program.
Fully trusted forms
Forms that are allowed full access to system resources, such as files on your computer or other settings, are called fully trusted forms. Fully trusted forms must be digitally signed by a trusted certificate or they must be installed by your users. This means that the form template must be packaged by using an installation program such as Microsoft Windows Installer.
Fully trusted forms can access information that is stored in the form itself and information from any of the following locations:
- The same domain as the form.
- All other domains that the form can access.
- All files and settings on the computer that the person filling out the form can access.
To deploy a fully trusted form that has been digitally signed, you must digitally sign the form with a trusted root certificate, after which you can publish the form by using the Publishing Wizard. As mentioned earlier, you can deploy a fully trusted form as an attachment to an e-mail message and then update the form via e-mail as well.
When you deploy a fully trusted form that users need to install, you're actually deploying an executable file that your users must install directly on their computers before they can fill out the form. You can deploy this file the same way that you deploy any other program, including sending it as an attachment in an e-mail message. However, if you update the form template after deploying it, you need to repackage and redeploy the form template in order to share the changes with your users.