Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How To: Change the Script Language for Your InfoPath Form


View products that this article applies to.

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.

↑ Back to the top


More information

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.
  3. Click the Advanced tab.
  4. Select your preferred language in the Form script language drop-down list, and then click OK.
  5. 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.
  1. Make a backup copy for your InfoPath form template (.xsn file).
  2. Open your template in Design mode in InfoPath.
  3. On the File menu, click Extract Form Files.

    The Browse for Folder dialog box appears.
  4. Select the folder that you want to extract the form files to, and then click OK.
  5. Close your form template.
  6. To modify Manifest.xsf, follow these steps:
    1. 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.
    2. 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>
    3. 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>
    4. Locate and then delete the following section:
      <xsf:scripts language="jscript">
           <xsf:script src="script.js"></xsf:script>
      </xsf:scripts>
      
    5. Save your changes to Manifest.xsf, and then close Script Editor.
  7. In Microsoft Windows Explorer, right-click Manifest.xsf, and then click Design.

    Your template opens in Design mode in InfoPath.
  8. On the File menu, click Save.
  9. To set your preferred script language, follow the steps in the "Change the Script Language for Your Form Template" section.

↑ Back to the top


References

For additional information about debugging the script in your InfoPath form template, click the following article number to view the article in the Microsoft Knowledge Base:
827002 HOW TO: Debug a Script for a Microsoft Office InfoPath 2003 Form

↑ Back to the top


Keywords: KB828853, kbhowto

↑ Back to the top

Article Info
Article ID : 828853
Revision : 4
Created on : 10/23/2006
Published on : 10/23/2006
Exists online : False
Views : 498