For more information about how security zones affect the level of access that forms have to the resources on your computer, click Microsoft Office InfoPath 2003 or Office InfoPath 2007 Help on the Help menu, type About security zones in the Search for box in the Assistance pane, and then click Start searching to view the topic.
- Make the form a fully-trusted URN-based form.
- Add the URL of the server that hosts the InfoPath form to the list of trusted sites in Microsoft Internet Explorer.
- Digitally sign a form template. (Apply for InfoPath)
Make the form a fully-trusted URN-based form
The fully-trusted URN-based form must be installed on your computer by using a custom install script or by using the Microsoft System Installer package. This permits ActiveX components to be created even if the ActiveX components are not marked Safe for untrusted script or Safe for untrusted initialization.
You can convert a standard form to a URN-based form manually. However, manual conversion is tedious and is prone to errors. You can also convert a standard form to a URN-based form by using the RegForm.exe tool that is the command-line form registration tool that is included with the InfoPath software development kit (SDK). The RegForm.exe tool makes the required changes to the form definition file and to the XML template file. The Regform.exe tool then repackages the files to an .xsn file and then creates a custom installation program for installing the modified form template.
The default installation location of the InfoPath 2003 SDK is C:\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office InfoPath 2003 SDK\Tools.
To see the command line options, type the following command line in a Command window:
The following command line produces a .js file and a .bak file in the same folder as the template that you are converting:
regform /U urn:MyForm:MyCompany /T Yes C:\MyForms\MyTrustedForm.xsn
To run the .js script, type the following code at the command line, and then press ENTER:
Cscript <full path of your .js file>
For more information about InfoPath 2007 and the InfoPath 2007 SDK, visit the following Microsoft Web site:
Add the URL of the server that hosts the InfoPath form to the list of trusted sites in Microsoft Internet ExplorerWhen you add the URL of the server that hosts the InfoPath form as a trusted site, you receive the following message when you run the code: If you click Yes, the code runs. If you click No, you may receive the error messages that are mentioned in the "Symptoms" section, and the code will not run.
To add a site as a trusted site, follow these steps:
- Start Internet Explorer.
- On the Tools menu, click Internet Options.
- In the Internet Options dialog box, click the Security tab.
- On the Security tab, click Trusted sites.
- Click Sites.
- Add the URL of the server that hosts the InfoPath form to the Add this Web site to the zone text box.
For example, if the name of the server that hosts the InfoPath form is MyServer, the URL that you must add to the text box is http://MyServer.
- Click Add.
This adds the newly-entered site to the Web sites list box.
- Click OK two times.
This commits the change and then closes the dialog box.
Digitally sign a form templateThis applies to InfoPath 2003 Service Pack 1. If you digitally sign a form template with a trusted certificate, you can set the security level for the form template to Full Trust. Full Trust means that the form can access files and settings on the user's computer or on a different domain. Additionally, you can deploy and update that form template by sending the form template and updated versions of the form template to others by using an e-mail program.
To digitally sign a form with a trusted certificate, follow these steps:
- In Design mode, click Form Options on the Tools menu.
- In the Form Options dialog box, click the Security tab in InfoPath 2003 or click to select the Security and Trust check box in InfoPath 2007.
- Under Form Signing in InfoPath 2003, click to select the Sign this form check box.
Under Form Template Signature in InfoPath 2007, click to select the Sign this form template check box.
- Click Select Certificate.
- In the Select Certificate dialog box, click the certificate that you want to digitally sign the form with.