// Borrowed, with modifications, from Shiraz Cupala's InfoPathDev blog // http://www.infopathdev.com/blogs/shiraz/archive/2007/08/16/best-way-to-launch-forms-from-web-pages.aspx function CreateNewXMLDocument(url) { try{ // Based on WPQ3combineDocuments() var objOpenXMLDoc = new ActiveXObject("SharePoint.OpenXMLDocuments.1"); var bSuccess = false; bSuccess = objOpenXMLDoc.CreateNewDocument2(window , url , url ); } catch(e) { // Some browsers will not support this feature. window.location = url; } } function OpenXMLDocument(url) { try { // Based on WPQ3combineDocuments() var objOpenXMLDoc = new ActiveXObject("SharePoint.OpenXMLDocuments.1"); var bSuccess = false; bSuccess = objOpenXMLDoc.EditDocument2(window , url , "InfoPath.Document" ); } catch(e) { // Some browsers will not support this feature. window.location = url; } }