InfoPath 其实就是一个cab包,把 xsn修改成cab,然后解压缩就能一览其组成。
有时候要做一些变态的事情,就是修改其里面的东西然后再弄回去。 直接的解压缩然后修改,再压缩回去时不管用的。
我自己也作了测试,修改一些东西,然后makecab回去,ok
保留代码以供
1. 建一个text文件,输入如下代码,修改必要的
;******************************************************************
.Set CabinetNameTemplate=Test.XSN
;**********************************************************************************************
; change the value of the Disk Directory Template value to the directory you want to store the xsn file into,,
;**********************************************************************************************
.set DiskDirectoryTemplate="E:\InfoPathCab\"
.Set Cabinet=on
.Set Compress=on
;*******************************************************
; Just List All the files to be added in the xsn file
;*******************************************************
"E:\InfoPathCab\manifest.xsf"
"E:\InfoPathCab\schema.xsd"
"E:\InfoPathCab\sampledata.xml"
"E:\InfoPathCab\schema1.xsd"
"E:\InfoPathCab\schema2.xsd"
"E:\InfoPathCab\schema3.xsd"
"E:\InfoPathCab\schema4.xsd"
"E:\InfoPathCab\template.xml"
"E:\InfoPathCab\view1.xsl"
;*********************
; End of the File
;*********************
2. 运行cmd,执行 MakeCab /f ***.txt
哎,后来发现, Infopath提供更好的方法 :
http://office.microsoft.com/en-gb/infopath-help/extract-or-combine-the-form-files-for-a-form-template-HP010064659.aspx#BM1
A form template is a single file that contains multiple supporting files, such as files that define how controls on the form template should appear, files for graphics that appear on the form template, and programming files that enable custom behaviors in the form template. These supporting files are collectively known as form files. When you design a form template, you can view and work with the form files that make up the form template by extracting and saving those form files to a folder.
InfoPath saves a copy of your form template (.xsn) file as a set of form files in the folder.
Note When you make changes to your form template after you extract the form files, your changes are saved to the form files in the folder rather than the form template file (.xsn).
After you extract a form template's form files and make changes to them, you can combine them back into a single form template file (.xsn) by publishing or saving the form template. After you combine the form files back into a single .xsn file, any changes that you make to the form template in InfoPath will be saved to the .xsn file and not to the form files that you extracted.
Note If you see a dialog box message about publishing your form template, click OK to close the dialog box.