Autechrian

Hello all,

I'm using InfoPath/SharePoint 2003 and I'm in the process on converting the code from jscript to managed code in VS2003 with VSTO. I've bumped into a rather basic problem: how do I submit the form using code to the sharepoint document library

In jscript you do it like this:

// Submit the form to the form library.

var objXmlHttp = new ActiveXObject("MSXML2.XMLHTTP.5.0");

objXmlHttp.Open("PUT", strUrl, false);
objXmlHttp.Send(XDocument.DOM.xml);

// Status codes of 200 or 201 indicate that the form
// has been submitted successfully.

if (objXmlHttp.Status == 200 || objXmlHttp.Status == 201)
{
blnSubmitSuccess = true;
}


and so on... but I can't figure out how to translate that to C#!

Anyone who knows

// Peter



Re: Visual Studio Tools for Office Submitting and Infopath form to SharePoint with managed code

Ji Zhou C MSFT

Hi,

You can add a submit data connection to your form template (Tools menu) to
submit the form to a SharePoint form library. There is already some discussion about that in Google Group. Please refer the following links:

http://groups.google.co.uk/group/microsoft.public.infopath/browse_thread/thread/a69e049bf9752739/7643cb45a8da8777 hl=en&lnk=st&q=submit+Infopath+form+to+sharepoint+using+C%23&rnum=2#7643cb45a8da8777

http://blogs.msdn.com/infopath/archive/2006/11/08/submitting-to-this-document-library.aspx

Thanks

Ji






Re: Visual Studio Tools for Office Submitting and Infopath form to SharePoint with managed code

Evjan

Thanks a lot Ji!

That second link was exactly what I needed. Sometimes you need help googling for the answer.

// Peter