Hi,
I need to publish a 2003 Compatible Form on multiple form libraries, and then each form has to be submitted on the document library were it was created.
Because the document libraries are more than 50 .. publishing manually does not seem the best choice, so I want to publish automatically.
The 2 ways of publishing(by code/power shell script) that I found are:
1. upload the file in the DocLibray\Form\ folder of each SPDocumentLibrary object and then modify the SPDocumentLibrary property DocumentTemplateURL to that file, but because that makes a complete copy, the template URI is not updated and that kills the dynamic submit.
2. to upload the file as content type and then add the content type in every document library, but that also kills the dynamic submit, because thisXDocument.Solution.URI returns the same url for all libraries.
So now I try to implement altenative scenarios ... like sending parameters to the form. But I don't know how to wire the new button on the docuement library to instantiate something like "/DocumentLibray/Forms/template.xsn?Save=DocumentLibrary"
To summarize:
1.Does anybody know how to publish an infopath form to a sharepoint library by code??
2.Does anybody know how to modify the template URI of an xsn (by modifying the publishUrl attribute in the myschema.xsd of the .xsn) ??
3.Does anybody know how to modify the javascript that the new button on a Document Library calls ??
An answer to any of these questions would solve my problem.
Thank you,
Andrei Gavrila