views:

119

answers:

1

So an InfoPath form is deployed to a SharePoint server. It gets deployed through central admin and then activated to a particular site collection. This site collection has a forms library with the appropriate content type for the activated InfoPath form.

Using the object model, how can I retrieve the form template back out of SharePoint programmatically. I know the url to the web, name of the list and the name of the form itself.

A: 

Found an answer myself that I'll post here for anyone else with the question:

using (SPSite site = new SPSite(siteUrl))
{
    using (SPWeb web = site.RootWeb)
    {
        SPList destinationList = web.Lists[listName];
        string formUrl = destinationList.ContentTypes[formName].DocumentTemplateUrl;
    }
}
Dan Revell