Design a New Form Template
- Create a new folder that is named c:\IPTest.
You will use this folder to store your form template. - Start InfoPath. Design a new, blank form.
- On the blank form, type Enter your name, and then press ENTER.
- Select the Controls task pane, and then click the Text Box control.
- Press ENTER two times.
- In the Controls task pane, click Check Box. Change the label for the check box control to Add me to your mailing list.
- On the File menu, click Extract Form Files.
The Browse for Folder dialog box appears.
Select c:\IPTest, and then click OK. - Close the IPTest form template.
Modify Template.xml
- Open Template.xml from c:\IPTest.
You can use a text editor or an XML editor. - Locate the processing instructions in Template.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?mso-infoPathSolution solutionVersion="1.0.0.2" href="manifest.xsf" productVersion="11.0.5531" PIVersion="1.0.0.0"?>
<?mso-application progid="InfoPath.Document"?>
- Add an xml-stylesheet processing instruction, and then remove the mso-application processing instruction.
The modified XML appears as follows: <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="C:\IPTest\view1.xsl"?>
<?mso-infoPathSolution solutionVersion="1.0.0.2" href="manifest.xsf" productVersion="11.0.5531" PIVersion="1.0.0.0"?>
Note Optionally, you can leave the mso-application processing instruction. You can do this if you want to open the form in InfoPath. Also, you cannot remove the mso-infoPathSolution processing instruction from the template. InfoPath cannot create new forms that are based on a template that is missing the mso-infoPathSolution processing instruction.
- Save your changes to Template.xml.
- Right-click c:\IPTest\manifest.xsf, and then click Design.
The form template opens in InfoPath in design mode. - On the
File menu, click Save As. Click Save if you are prompted to publish or to save the form template. Save the template as c:\IPTest\IPTest.xsn.
- Close InfoPath.
Save Two Forms
- To fill out a form in InfoPath, double-click c:\IPTest\IPTest.xsn in Microsoft Windows Explorer.
- Type a name in the text box, and then click to select the check box control.
- On the File menu, click Save As. Save the form as c:\IPTest\Form1.xml.
- Repeat step 2 and step 3. Use different input data to create c:\IPTest\Form2.xml.
Display the Formatted Form Data in Internet Explorer
- Start Internet Explorer.
- In the Address box, type c:\IPTest\Form1.xml, and then click Go.
The XML data is rendered and then transformed in Internet Explorer by using the View1.xsl style sheet. - Repeat step 2 for c:\IPTest\Form2.xml.
Considerations and Cautions
The steps in this article describe how to save an InfoPath solution and how to create an InfoPath form template with custom modifications on your local computer. In a production environment, you must use caution when you save forms that have custom modifications to your local computer. While the transform can succeed when you run the transform from the local computer, any script or any HTML in the transformed file runs with the administrative credentials of the local computer. Therefore, arbitrary scripts in the file may run without warning and may create potential security issues.
You must also be aware that if you use a transform for your XML data so that you can display InfoPath data in Internet Explorer, some of the form functionality that is present in InfoPath is not present in Internet Explorer. For example, custom scripts and secondary data sources in the solution may not function the same when the form appears in Internet Explorer.
REFERENCES
For additional information about the features and benefits of using InfoPath for your forms, click the following article number to view the article in the Microsoft Knowledge Base:
826991�
Install InfoPath to access features and benefits