Search code examples
c#automationinfopath

C# to fill out InfoPath Form programmatically?


Is it possible to fill out an infopath form and submit it via a C# console application?

If yes, then how?


Solution

  • Yes, you can create a XML file within your C# application and push it to your Sharepoint Form Library. Sharepoint won't realize any difference.

    Just ensure two things:

    • Your XML must validate against the Infopath schema.
    • Remember to add the XML processing instructions, so that Sharepoint and Infopath know how to handle the XML file. (Simply 'steal' it from an Infopath generated XML.)