开发者

Programmatically retrieve a form template from a SharePoint library

开发者 https://www.devze.com 2022-12-24 22:48 出处:网络
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 app

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 o开发者_JAVA百科f the list and the name of the form itself.


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;
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消