Infopath 2010 Code - InfoPath Dev
in

InfoPath Dev

Infopath 2010 Code

Last post 11-14-2011 10:49 PM by Jimmy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-14-2011 12:01 PM

    • JoelW
    • Not Ranked
    • Joined on 03-06-2009
    • Posts 18

    Infopath 2010 Code

    My company is about to upgrade to Office 2010 and from what I understand InfoPath 2010 does not recognize JScript code, which of course is the code that all of our forms use.  My question is, does anyone know the .NET commands to Print, Save, and Submit via Email?  Those are the only functions my codes perform so I'm wondering if there is a .NET equivalent I can use instead. 

  • 11-14-2011 12:54 PM In reply to

    • bobga
    • Not Ranked
    • Joined on 12-22-2010
    • Posts 9

    We have also upgraded to office 2010.  I found that the jscript code will work without any problems.  In order to change the code, you need to do the following:

     

    Directions for changing Jscript code or changing xml code in an InfoPath 2010 program.The template.xsn file is a compressed file that contains multiple xml files.  There are two files I change often.  One is the manifest.xsf file which contains the form’s main xml code.  I sometimes have to change the order of the user roles and the only way to do it is by moving them in the XML.  Another file I need to change is titled script.js.  That is where your Jscript code is kept.  InfoPath 2010 does not allow you to create Jscript code, but will execute it.  So if you need to maintain old Jscript code or want to continue using Jscript, this is how you can do it.  Follow the steps below:1.      Load the InfoPath program you want to change in design mode.2.      Go to Publish>Export Source files.  3.      Close the InfoPath program.4.      Store the exported files in a new subdirectory.5.      Open the files you need to change using Microsoft Visual Studio or Notepad and make necessary changes.  Save the file back.6.      Construct a makecab.ddf file as follows using Notepad:The first four lines should contain.OPTION EXPLICIT.Set cabinetnametemplate=Mycab.cab.Set cabinet=on.Set compress=onList the names of all files that were exported enclosed in quotes, one per line.  For example, “manifest.xsf”.7.      Save the makecab.ddf file in the export subdirectory.8.      Click on the round windows icon on the toolbar at the bottom on the screen9.      Enter CMD in the search box just above the icon.  This puts you in command line mode.10.   Change directory to the export subdirectory.11.   Enter   makecab /f makecab.ddf.  This creates a cabinet file which is a compressed file just like the .xsn file you started with in a subdirectory titled disk1 within your export subdirectory.12.   Go to the disk1 directory and rename the file template.xsn.13.   Open the template.xsn with the InfoPath Designer by right clicking on the file and choose Design.14.   Republish the InfoPath form.

     

  • 11-14-2011 10:49 PM In reply to

    There's no need to go through all that makecab business.  Just right-click manifest.xsf and select Design.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.