<?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: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14193.aspx</link><pubDate>Thu, 19 Jan 2006 18:41:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14193</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14193.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14193</wfw:commentRss><description>Awesome! I'm glad you got everything working! Let us know if you have any more questions.&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14192.aspx</link><pubDate>Thu, 19 Jan 2006 18:20:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14192</guid><dc:creator>Pich</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14192.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14192</wfw:commentRss><description>Thank you very mutsh, the code works, and my knowledge in code beggins to grow (from nothing...:p )&lt;br /&gt;&lt;br /&gt;Thank you again for all the help you gave me !!!&lt;br /&gt;&lt;br /&gt;BR,&lt;br /&gt;&lt;br /&gt;Pich</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14191.aspx</link><pubDate>Thu, 19 Jan 2006 16:30:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14191</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14191.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14191</wfw:commentRss><description>This probably has to do with your XPath, try adding the namespace on the first node:&lt;br /&gt;&lt;br /&gt;oEmail.To = XDocument.DOM.selectSingleNode("dfs:myFields/dfs:dataFields/d:MainData/@Mail").text;&lt;br /&gt;&lt;br /&gt;When you get the "Object required" error it is almost always an XPath error.&lt;br /&gt;&lt;br /&gt;I'm not sure what you mean by your second question, but to concatenate the e-mail addresses try something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;var nodesAllEmails = XDocument.DOM.selectNodes( "dfs:myFields/dfs:dataFields/d:MainData/@Mail" );&lt;br /&gt;var sAllEmails = "";&lt;br /&gt;while( oneEmail = nodesAllEmails.nextNode() )&lt;br /&gt;{&lt;br /&gt;	sAllEmails += oneEmail.text + "; ";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Just for debugging&lt;br /&gt;XDocument.UI.Alert( sAllEmails );&lt;br /&gt;&lt;br /&gt;oEmail.To = sAllEmails;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14190.aspx</link><pubDate>Thu, 19 Jan 2006 10:14:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14190</guid><dc:creator>Pich</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14190.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14190</wfw:commentRss><description>Ok, no problem :)&lt;br /&gt;&lt;br /&gt;My code looks-like that for the moment : &lt;br /&gt;&lt;br /&gt;oEmail.To = XDocument.DOM.selectSingleNode("myFields/dfs:dataFields/d:MainData/@Mail").text;&lt;br /&gt;&lt;br /&gt;But it returns me an error : Object Required&lt;br /&gt;I'm not sure of the references, what do you think about?&lt;br /&gt;Another question : Have I to write the code to find the node directly after oEmail.To ?&lt;br /&gt;And for finish, I don't know how to concatentate them. The SelectStringNode method give only the first node of the node-set.&lt;br /&gt;&lt;br /&gt;BR,&lt;br /&gt;Thank you for all.&lt;br /&gt;&lt;br /&gt;Pich&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14189.aspx</link><pubDate>Wed, 18 Jan 2006 17:21:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14189</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14189.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14189</wfw:commentRss><description>XPath is used to traverse the DOM of your schema.&lt;br /&gt;&lt;br /&gt;If you made a blank new form and inserted one text field the XPath to get to that node would be:&lt;br /&gt;&lt;br /&gt;"/my:myFields/my:field1"&lt;br /&gt;&lt;br /&gt;Also, I'm sorry about the confusion, but instead of &lt;br /&gt;XDocument.selectSingleNode()&lt;br /&gt;it should be&lt;br /&gt;XDocument.&lt;b&gt;DOM&lt;/b&gt;.selectSingleNode()&lt;br /&gt;I guess I forgot - my apologies!&lt;br /&gt;&lt;br /&gt;Here is further reference for XPath:&lt;a target="_blank" href=http://www.w3schools.com/xpath/default.asp&gt;http://www.w3schools.com/xpath/default.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14188.aspx</link><pubDate>Wed, 18 Jan 2006 17:07:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14188</guid><dc:creator>Pich</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14188.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14188</wfw:commentRss><description>In this line : &lt;br /&gt;&lt;br /&gt;XDocument.selectSingleNode( "XPath/To/Email/Node" ).text; &lt;br /&gt;&lt;br /&gt;I don't understant the "XPath/To/Email/Node". &lt;br /&gt;I think it's about reference to the form but I don't know which reference I have o use.&lt;br /&gt;&lt;br /&gt;Can you help me on this point?&lt;br /&gt;&lt;br /&gt;BR&lt;br /&gt;&lt;br /&gt;Pich</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14187.aspx</link><pubDate>Wed, 18 Jan 2006 02:27:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14187</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14187.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14187</wfw:commentRss><description>Instead of using "thisXDocument" use "XDocument".&lt;br /&gt;&lt;br /&gt;thisXDocument - C# an VB.NET&lt;br /&gt;XDocument - JScript and VBScript&lt;br /&gt;&lt;br /&gt;Hope this helps!&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14186.aspx</link><pubDate>Tue, 17 Jan 2006 15:08:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14186</guid><dc:creator>Pich</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14186.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14186</wfw:commentRss><description>The problem is, when i use &lt;br /&gt;thisXDocument.selectSingleNode( "XPath/To/Email/Node" ).text;&lt;br /&gt;it returns me an error : 'thisXDocument' is undefined'&lt;br /&gt;&lt;br /&gt;What I want to do is send an e-mail to all the Email adresses saved in the DataBase linked to the form.&lt;br /&gt;&lt;br /&gt;I thank to use thisXDocument.selecNodes but I don't know how to use it...!&lt;br /&gt;&lt;br /&gt;This mail have to contain a picture as attachment.&lt;br /&gt;&lt;br /&gt;The code for the moment :&lt;br /&gt;&lt;br /&gt;&lt;font color="blue"&gt;function&lt;/font id="blue"&gt; CTRL80_14::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;font color="green"&gt;//Get the email adapter&lt;/font id="green"&gt;&lt;br /&gt;&lt;font color="blue"&gt;var&lt;/font id="blue"&gt; oEmail;&lt;br /&gt;oEmail = XDocument.DataAdapters("Mail");&lt;br /&gt;	&lt;br /&gt;&lt;font color="green"&gt;//email's body&lt;/font id="green"&gt;&lt;br /&gt;oEmail.Intro = "les offres de Janvier"&lt;br /&gt;&lt;br /&gt;&lt;font color="green"&gt;//Set the to address&lt;/font id="green"&gt;&lt;br /&gt;oEmail.To = "xxx@yyy.com"&lt;br /&gt;&lt;br /&gt;&lt;font color="green"&gt;//Submit the email&lt;/font id="green"&gt;&lt;br /&gt;oEmail.Submit();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BR Pich&lt;br /&gt;</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14185.aspx</link><pubDate>Mon, 16 Jan 2006 17:04:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14185</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14185.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14185</wfw:commentRss><description>Good job on resolving your problem!  To get the e-mail addresses from your form you can use a line of code like this:&lt;br /&gt;&lt;br /&gt;thisXDocument.selectSingleNode( "XPath/To/Email/Node" ).text;&lt;br /&gt;&lt;br /&gt;After you get all the e-mail addresses you can concatentate them together in the oEmail.To line. Make sure to seperate with a ; .&lt;br /&gt;&lt;br /&gt;What's wrong with editing the body? Are you saying the code executes fine, but when you submit it it reverts back? Please post the whole source code.&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14184.aspx</link><pubDate>Mon, 16 Jan 2006 14:07:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14184</guid><dc:creator>Pich</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14184.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14184</wfw:commentRss><description>Ok, I resolved the last problem!&lt;br /&gt;&lt;br /&gt;The different titles are the names of the buttons.&lt;br /&gt;&lt;br /&gt;One more precision, I don't know how to link the field in which i entered the email adresses.&lt;br /&gt;&lt;br /&gt;Indeed, I want to send email to all adresses entered in the form.&lt;br /&gt;In : oEmail.To = "mail adress" I don't know how set the field reference, the code needs a valid adress.&lt;br /&gt;More Over, I need help about setting the email body. For the moment I use : bjEmailAdapter.Intro = "intro" but i can't edit the email when submitting.&lt;br /&gt;&lt;br /&gt;BR&lt;br /&gt;&lt;br /&gt;Pich</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14183.aspx</link><pubDate>Mon, 16 Jan 2006 09:49:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14183</guid><dc:creator>Pich</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14183.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14183</wfw:commentRss><description>Thank you,&lt;br /&gt;&lt;br /&gt;I begin to understand the "meaning" of this code, and the description you made of the different steps was very clear for me.&lt;br /&gt;&lt;br /&gt;Just one more question about it, i don't know where I've to copy this code when I'm editing the button's code.&lt;br /&gt;There is some place where I can write code as :&lt;br /&gt;- CTRL136_7::OnClick(eventObj)&lt;br /&gt;- XDocument::OnLoad(eventObj)&lt;br /&gt;- CTRL211_7::OnClick(eventObj)&lt;br /&gt;- XDocument::OnSaveRequest(eventObj)&lt;br /&gt;- XDocument::OnSign(eventObj)&lt;br /&gt;and 5 more "On sign" titles, can you help me on the meaning of the different part of the code, and how I can use them.&lt;br /&gt;&lt;br /&gt;Thank you again for your help,&lt;br /&gt;&lt;br /&gt;BR&lt;br /&gt;&lt;br /&gt;Pich</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14182.aspx</link><pubDate>Tue, 10 Jan 2006 20:12:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14182</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14182.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14182</wfw:commentRss><description>To use this code, you will first have to add E-mail as a Submitting Data Source. &lt;br /&gt;&lt;br /&gt;1) In Design mode, choose Data Connections from the Tools Menu and then click Add.&lt;br /&gt;2) Select Submit Data, and then click Next.&lt;br /&gt;3) Select as an e-mail message, and then click Next.&lt;br /&gt;4) Delete all text in all textboxes on the window (you will be adding all of this content back in later using code). Click Next.&lt;br /&gt;5) On the next window enter a name into the textbox. Remember what you name it. Click Finish.&lt;br /&gt;&lt;br /&gt;Edit the following line in your code:&lt;br /&gt;&lt;br /&gt;//Get the email adapter&lt;br /&gt;EmailAdapter oEmail = (EmailAdapter)thisXDocument.DataAdapters["&lt;b&gt;THE NAME YOU TYPED IN STEP FIVE&lt;/b&gt;"];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also, you might play around with the window box in step 4 so that you don't have to add everything back using code.&lt;br /&gt;&lt;br /&gt;Hope this helps, let us know if you have any more problems!&lt;br /&gt;&lt;br /&gt;PS - "whish" and "wish" should be "which" ("wish" has a very different meaning). Other than that your english is very good!&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14181.aspx</link><pubDate>Tue, 10 Jan 2006 17:43:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14181</guid><dc:creator>Pich</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14181.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14181</wfw:commentRss><description>Thx a lot, it can help me !&lt;br /&gt;&lt;br /&gt;The problem is I dont know how to use this code... xD&lt;br /&gt;I don't have any knowledge in programmation; i'm learning but it's diffficult...&lt;br /&gt;&lt;br /&gt;Can u help using this code, just say me whish word are important in the code, wish i have to change and where i have to writte the script in the code page of the button :&lt;br /&gt;&lt;br /&gt;&lt;font color="green"&gt;//Get the email adapter&lt;br /&gt;EmailAdapter oEmail = (EmailAdapter)thisXDocument.DataAdapters["Email"];&lt;br /&gt;&lt;br /&gt;//Set the to address&lt;br /&gt;oEmail.To = "abc#xyz.com";&lt;br /&gt;//In the above statement you can get the emailId from any one of the field that is in your form/Dataconnections.&lt;br /&gt;&lt;br /&gt;//Submit the email&lt;br /&gt;oEmail.Submit();&lt;/font id="green"&gt;&lt;br /&gt;&lt;br /&gt;Thx for all...&lt;br /&gt;&lt;br /&gt;BR&lt;br /&gt;&lt;br /&gt;Pich</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14180.aspx</link><pubDate>Tue, 10 Jan 2006 17:34:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14180</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14180.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14180</wfw:commentRss><description>Welcome to the forums, Pich and uma!&lt;br /&gt;&lt;br /&gt;Check out these threads and I think you will find an answer:&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://infopathdev.com/forums/topic.asp?TOPIC_ID=1006&gt;http://infopathdev.com/forums/topic.asp?TOPIC_ID=1006&lt;/a&gt;&lt;br /&lt;a target="_blank" href=http://infopathdev.com/forums/topic.asp?TOPIC_ID=621&gt;http://infopathdev.com/forums/topic.asp?TOPIC_ID=621&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Send mail from form</title><link>https://www.infopathdev.com:443/forums/thread/14179.aspx</link><pubDate>Tue, 10 Jan 2006 16:03:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14179</guid><dc:creator>Pich</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14179.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14179</wfw:commentRss><description>Thank you for your answer !&lt;br /&gt;&lt;br /&gt;By template I mean a preformated email.&lt;br /&gt;So, I want to send this email from the form, and not send the form by email.&lt;br /&gt;The emails I want to send are about other data.&lt;br /&gt;&lt;br /&gt;i just want to create a button wich permit me to open a new mail when i click on it?&lt;br /&gt;&lt;br /&gt;Is it possible?&lt;br /&gt;&lt;br /&gt;BR,&lt;br /&gt;&lt;br /&gt;Pich&lt;br /&gt;** so sorry for my english ""</description></item></channel></rss>