You can call the method below to list out all the infoptah form templates available in SharePoint 2010 farm and then check if your desired form is installed.
private void GetAllInfoPathForms()
{
DataTbale dt;
FormsService _formsService;
SPFarm localFarm = SPFarm.Local;
try
{
//Get the local infopath service name
_formsService = localFarm.Services.GetValue(FormsService.ServiceName);
foreach (FormTemplate fTemplate in _formsService.FormTemplates)
{
dt.Rows.Add(fTemplate.DisplayName.ToString(), fTemplate.FormId.ToString(), fTemplate.Locale.ToString());
int intRow = dt.DefaultView.Find("yourInfoPathTemplateName");
if(intRow != null)
{
string _found = "Found the Form";
}
}
}
catch (Exception ex)
{
MessageBox.Show("An error occurred: " + ex.Message.ToString());
}
}
Ads by Google
No comments:
Post a Comment