How to create an InfoPath form programmatically

H

Hu

I have an InfoPath form template. Can I create an InfoPath form from an .aspx
page using that template? Thanks.
 
G

Gavin McKay

Hello,

I haven't tried any of these, but a couple of ways you could do it might be:

1. Instantiate a copy of the Infopath client and create a form. Since you
want to do this on the server, this isn't an ideal solution.

2. Use InfoPath forms services to create a new form. Not really an option
if you don't have forms services of course...

3. Use the Infopath object model to create the form.

4. A more manual method would be to "pre-create" an xml file based on your
template. i.e. use Infopath, create a new form based on your form template,
save the xml locally somewhere and then use this as your "template" in your
..aspx page. You could then open this xml file and populate it with data as
required, saving when necessary. This might be your safest option.

HTH

Gavin.
 
Top