FormsService.BrowserEnableUserFormTemplate(SPFile) FormsService.BrowserEnableUserFormTemplate(SPFile) FormsService.BrowserEnableUserFormTemplate(SPFile) FormsService.BrowserEnableUserFormTemplate(SPFile) Method

Definition

Browser-enables a browser-compatible form template that does not contain form code, require full trust, enable rendering on a mobile device, or use a data connection managed by a server administrator.

public:
 Microsoft::Office::InfoPath::Server::Administration::ConverterMessageCollection ^ BrowserEnableUserFormTemplate(Microsoft::SharePoint::SPFile ^ solutionFile);
public Microsoft.Office.InfoPath.Server.Administration.ConverterMessageCollection BrowserEnableUserFormTemplate (Microsoft.SharePoint.SPFile solutionFile);
member this.BrowserEnableUserFormTemplate : Microsoft.SharePoint.SPFile -> Microsoft.Office.InfoPath.Server.Administration.ConverterMessageCollection
Public Function BrowserEnableUserFormTemplate (solutionFile As SPFile) As ConverterMessageCollection

Parameters

solutionFile
SPFile SPFile SPFile SPFile

The form template file (.xsn) file to browser-enable.

Returns

Returns a collection of messages that describe the results of the form template conversion.

Examples

In the following code example, a file that has been uploaded to a form library is browser-enabled.

    Dim LocalFormsService As FormsService
Dim LocalFarm As SPFarm = SPFarm.Local
Dim LocalSite As SPSite = New SPSite("http://<span class="placeholder">ServerName</span>")
Dim LocalWeb As SPWeb = LocalSite.AllWebs("<span class="placeholder">SiteName</span>")
Dim LocalFile As SPFile
Try
    LocalFormsService = LocalFarm.Services.GetValue(Of FormsService)(FormsService.ServiceName)
    LocalFile = LocalWeb.GetFile("<span class="placeholder">FormLibrary</span>/Forms/<span class="placeholder">FormTemplate.xsn</span> ")
    LocalFormsService.<span class="label">BrowserEnableUserFormTemplate</span>(LocalFile)
    Console.Write("Press Enter to Continue")
    Console.ReadLine()
Catch ex As Exception
    Console.WriteLine("Error: " + ex.Message)
    Console.Write("Press Enter to Continue")
    Console.ReadLine()
End Try
    FormsService localFormsService;
SPFarm localFarm = SPFarm.Local;
SPSite localSite = new SPSite("http://<span class="placeholder">ServerName</span>");
SPWeb localWeb = localSite.AllWebs["<span class="placeholder">SiteName</span>"];
try
{
    localFormsService = localFarm.Services.GetValue&lt;FormsService&gt;(FormsService.ServiceName);
    SPFile localFile = localWeb.GetFile("<span class="placeholder">FormLibrary</span>/Forms/<span class="placeholder">FormTemplate.xsn</span>");
    localFormsService.<span class="label">BrowserEnableUserFormTemplate</span>(localFile);
    Console.Write("Press Enter to Continue");
    Console.ReadLine();
}
catch (Exception ex)
{
    Console.WriteLine("Error: " + ex.Message);
    Console.Write("Press Enter to Continue");
    Console.ReadLine();
}

Remarks

A manifest (.xsf) file of a browser-compatible form template can be used in the solutionFile parameter if all supporting files are located in the same folder. For form templates that contain code, use the methods of the FormTemplateCollection collection and the FormTemplate object.

Applies to