Newbie Question: Multiple Script Files in Single InfoPath Form

W

Warwick Foster

Hello folks,

Could someone please tell me how to correctly reference an additional script
file?

As a developer I want to include a number of code modules into the scipt
section of an InfoPath form. In reading through the associated documentation
I noted the use of the following XML tags in the manifest.xsf:

<xsf:file name="script2.vbs">
<xsf:fileProperties>
<xsf:property name="scriptType" type="string"
value="userEvents"></xsf:property>
</xsf:fileProperties>
</xsf:file>
<xsf:file name="script.vbs">
<xsf:fileProperties>
<xsf:property name="scriptType" type="string"
value="userEvents"></xsf:property>
</xsf:fileProperties>
</xsf:file>
and
<xsf:scripts language="vbscript.encode">
<xsf:script src="script.vbs"></xsf:script>
<xsf:script src="script2.vbs"></xsf:script>
</xsf:scripts>


Using both of these tags I hopped to import an additional script file which
I would use to include a library of interchangeable function. But to no
avail. The scripting engine would only allow me access to the first file
defined in the <Files> tag (the contining tag for the two <File> elements.

Could someone please tell me how to correctly reference an additional script
file?

Thank you all for taking the time to get this far down the email.
 
G

Greg Collins [InfoPath MVP]

Did you also include the second script file as a resource to your form template? This is required.
 
W

Warwick Foster

Thanks Greg,

Unsure how to make this work. Could you write me up a simple procedure on
how to add it in or point me some documentation on how to do it?

Thank you
 
G

Greg Collins [InfoPath MVP]

In the designer, you must go to Tools | Resource Files and then make sure that you add your second script file in there.

You must do the update you did in the manifest, but you also must add your script file as a resource to the template.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top