tags:

views:

515

answers:

4

Is it possible to programmatically generate an info path 2007 form template (xsn file=form definition) ?

I know that there is no object model for the infopath 2007 form designer, but does anyone know of any third party libraries?

The form view itself is a xsl file so it should be possible. I would have thought that its a common use case also.

Thanks in advance,

Matt

A: 

It is possible to generate the manifest.xsf, xsl and xml files from a structured source (let's say an xml) and then pack this (as .cab) with the extension .xsn
(The .xsn file is nothing but a renemed .cab!)

This is only a raw concept - it could be refined if the purpose was a bit more explicit. Why generate? Are you going to create a bunch of different files? What for?

MrFox
Furthermore, if all these forms have certain fields in them, he can add them to infopath and then go to file>save as source files so that he has a template off of which to base his files.
Matt Boehm
A: 

There are no libraries or API's to do this. While generating a template is possible you will need to write it all yourself. Obviously this will not be an easy task and will be prone to errors. I would recommend reviewing your requirements to ensure this is truly necissary. InfoPath is quite flexible, without knowing the details of your project, there is a good chance you can get the functionality you need with a single template.

oillio
A: 

I have exactly same issue. How to create a InfoPath template programmatically. I need to create dynamic template on the fly. Any suggestions, methods are welcomed. http://www.infopathdev.com/forums/t/12668.aspx

Pradip Shrestha
A: 

Even I'm facing the same kind of issue. I have to create an infopath template on the fly, where in which i have to populate old data for users to view and also user will submit new data in the same form.

i googled for hours in vain to find out that no proper APIs available for infopath like we have for Excel.

Pointers will be helpful.

keevas

related questions