Microsoft KB Archive/828853

= How To: Change the Script Language for Your InfoPath Form =

Article ID: 828853

Article Last Modified on 10/23/2006

-

APPLIES TO


 * Microsoft Office InfoPath 2003

-





SUMMARY
This article describes how to change the script language for your InfoPath form template.

If you have already started Microsoft Script Editor for a form template, you can only change the script language by first removing the existing script from the form template. This article also describes how you can remove the script from your template so that you can change the script language.



Change the Script Language for Your Form Template

 * 1) Open your template in Design mode in InfoPath.
 * 2) On the Tools menu, click Form Options.

The Form Options dialog box appears.
 * 1) Click the Advanced tab.
 * 2) Select your preferred language in the Form script language drop-down list, and then click OK.
 * 3) 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.</li>  Locate and then delete the following section: <xsf:file name=&quot;script.js&quot;> <xsf:fileProperties> <xsf:property name=&quot;scriptType&quot; type=&quot;string&quot; value=&quot;userEvents&quot;></xsf:property> </xsf:fileProperties> </xsf:file> </li>  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=&quot;jscript&quot; fullyEditableNamespace=&quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-09-10T17:55:25&quot; lastOpenView=&quot;view1.xsl&quot;></xsf:solutionProperties>

After you delete the scriptLanguage attribute, thexsf:solutionProperties node will read as follows:: <xsf:solutionProperties fullyEditableNamespace=&quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-09-10T17:55:25&quot; lastOpenView=&quot;view1.xsl&quot;></xsf:solutionProperties> </li>  Locate and then delete the following section: <xsf:scripts language=&quot;jscript&quot;> <xsf:script src=&quot;script.js&quot;></xsf:script> </xsf:scripts> </li> Save your changes to Manifest.xsf, and then close Script Editor.</li></ol> </li> In Microsoft Windows Explorer, right-click Manifest.xsf, and then click Design.

Your template opens in Design mode in InfoPath.</li> On the File menu, click Save.</li> To set your preferred script language, follow the steps in the &quot;Change the Script Language for Your Form Template&quot; section.</li></ol>

<div class="references_section">