Launch WSS forms library InfoPath form from a web page
You have a form that was published to a Windows SharePoint Services (WSS) site's forms library and would like to be able to launch InfoPath to fill out the form by clicking on a hyperlink on a web page.
You can accomplish this functionality as follows:
- Copy and paste the following code in the <HEAD> of your web page:
var strTemplate = "http://<SERVER>/sites/<WSS_SITE>/<WSS_FORMS_LIB>/Forms/template.xsn";
var strSaveLocation = "/sites/<WSS_SITE>/<WSS_FORMS_LIB>";
var strProgID = "SharePoint.OpenXMLDocuments";
createNewDocumentWithProgID(escapeProperlyCore(strTemplate, true), makeAbsUrl(strSaveLocation), strProgID, true);
- Add a hyperlink to the <BODY> of your web page:
You should now have a link on your web page that when clicked on will open the InfoPath form template that was published to your Windows SharePoint Services site's forms library to be filled out and saved back into the WSS forms library.
NOTE: If the location of the forms library specified in your web page differs from the location of the forms library specified in the form, then the form will be submitted to the location indicated within the form and not to the one specified in your web page.
Related InfoPath Articles:
- Force InfoPath browser-enabled form to open in the browser
- How to publish an InfoPath 2007 browser form to SharePoint
- Open an InfoPath form from a link in SharePoint 2010
- 2 Ways to add and display a hyperlink in InfoPath 2010
- Attach an InfoPath form to a SharePoint list item (no code)
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author.