Change the Script Language for Your Form Template
- Open your template in Design mode in InfoPath.
- On the Tools menu, click Form Options.
The Form Options dialog box appears. - Click the Advanced tab.
- Select your preferred language in the Form script language drop-down list, and then click OK.
- On the Tools menu, point to Script, and then click Microsoft Script Editor.
Microsoft Script Editor appears.
Remove the Script from Your Form Template
Important The following steps remove any existing script from your form template. To successfully change your scripting language after you have started Script Editor for your form template, you must complete all the following steps.
- Make a backup copy for your InfoPath form template (.xsn file).
- Open your template in Design mode in InfoPath.
- On the File menu, click Extract Form Files.
The Browse for Folder dialog box appears. - Select the folder that you want to extract the form files to, and then click OK.
- Close your form template.
- To modify Manifest.xsf, follow these steps:
- Start a text editor such as Notepad, or start an XML editor such as Visual Studio .NET. Open Manifest.xsf that is located in the folder where you extracted your form files.
- Locate and then delete the following section:
<xsf:file name="script.js">
<xsf:fileProperties>
<xsf:property name="scriptType" type="string" value="userEvents"></xsf:property>
</xsf:fileProperties>
</xsf:file>
- Locate the xsf:solutionProperties node, and then delete the scriptLanguage attribute.
For example, if your InfoPath form currently uses JScript for the script language, the xsf:solutionProperties node will read as follows:<xsf:solutionProperties scriptLanguage="jscript" fullyEditableNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-09-10T17:55:25" lastOpenView="view1.xsl"></xsf:solutionProperties>
After you delete the scriptLanguage attribute, thexsf:solutionProperties node will read as follows::<xsf:solutionProperties fullyEditableNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-09-10T17:55:25" lastOpenView="view1.xsl"></xsf:solutionProperties>
- Locate and then delete the following section:
<xsf:scripts language="jscript">
<xsf:script src="script.js"></xsf:script>
</xsf:scripts>
- Save your changes to Manifest.xsf, and then close Script Editor.
- In Microsoft Windows Explorer, right-click Manifest.xsf, and then click Design.
Your template opens in Design mode in InfoPath. - On the File menu, click Save.
- To set your preferred script language, follow the steps in the "Change the Script Language for Your Form Template" section.