<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Record a form to two differents destinations</title><link>https://www.infopathdev.com:443/forums/thread/24086.aspx</link><pubDate>Wed, 31 Oct 2007 17:00:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24086</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24086.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=24086</wfw:commentRss><description>&lt;p&gt;The last error message is something&amp;nbsp;like &amp;quot;the context of the object model call is invalid&amp;quot;.&lt;/p&gt;
&lt;p&gt;Anyway, the issue is here: &lt;strong&gt;eventObj.PerformSaveOperation(XDocument.SaveAs(Path &amp;amp; Nom + &amp;quot;.xml&amp;quot;)) &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You cannot have the SaveAs() method inside the PerformSaveOperation() method... this is invalid. You must use one or the other.&lt;/p&gt;
&lt;p&gt;SaveAs() requires your form to be set to Full Trust... but is the method you need in order to save to a specific location.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t recall for certain whether you need to use &amp;quot;E:\\Test\\&amp;quot; or if &amp;quot;E:\Test\&amp;quot;, as you have it now, will work fine.&lt;/p&gt;</description></item><item><title>Record a form to two differents destinations</title><link>https://www.infopathdev.com:443/forums/thread/24030.aspx</link><pubDate>Mon, 29 Oct 2007 11:31:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:24030</guid><dc:creator>battosaino</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/24030.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=24030</wfw:commentRss><description>&lt;p&gt;Hello everybody.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;I am using Infopath 2003 and have the following issue: I&amp;#39;would like to create a form which will be record into two differents containers. That when the user will click on a submit button. The destinations are:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. A SharePoint directory&lt;/p&gt;&lt;p&gt;&amp;nbsp;2. A network directory.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;The first option is not problem, as Infopath can manage the connection toward a Infopath Library. The problem I meet is for recording into the network directory. I use VBS. Here is the code: &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Code\&lt;/p&gt;&lt;p&gt;&amp;nbsp;XDocument.DOM.setProperty &amp;quot;SelectionNamespaces&amp;quot;, &amp;quot;xmlns:my=&amp;quot;&amp;quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-09-13T12:12:25&amp;quot;&amp;quot;&amp;quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp;	Path = &amp;quot;E:\Test\&amp;quot;
	&lt;/p&gt;&lt;p&gt;&amp;nbsp; Nom = &amp;quot;FichierTest_241207&amp;quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Sub CTRL50_5_OnClick(eventObj)&amp;nbsp;
&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  	XDocument.UI.Alert(&amp;quot;This is a test.&amp;quot;)
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; 	If(XDocument.IsDirty)Then
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  		XDocument.UI.Alert(&amp;quot;Doc has been modified&amp;quot;)
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.UI.Alert(&amp;quot;Doc has been changd&amp;quot;)
		
	&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End If 
&lt;/p&gt;&lt;p&gt;End Sub&lt;/p&gt;&lt;p&gt;Sub XDocument_OnSaveRequest(eventObj)&amp;nbsp;
&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  eventObj.IsCancelled = eventObj.PerformSaveOperation(XDocument.SaveAs(Path &amp;amp; Nom + &amp;quot;.xml&amp;quot;))
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; eventObj.ReturnStatus = True&lt;br /&gt;End Sub&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;/Code &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The message I get, when I modified the form and accepted to record is the following:&lt;/p&gt;&lt;p&gt;&amp;quot;InfoPath cannot record the form under the following name: E\Test\FithierTest_241207.xml.&amp;quot; &amp;quot;Contexte de l&amp;#39;appel de modèle objet non valide&amp;quot; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;(I don&amp;#39;t know how to translate the laste sentence)&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Have you got any Idea of what I can do?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Best regard&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>