<?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: DataAdapters syntax</title><link>https://www.infopathdev.com:443/forums/thread/30595.aspx</link><pubDate>Fri, 18 Jul 2008 23:11:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30595</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30595.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30595</wfw:commentRss><description>&lt;p&gt;Okay, using VB.NET and IP2007:&lt;/p&gt;
&lt;blockquote&gt;&lt;font size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39; Get the e-mail submit data connection configured for the form.&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; mySubmit &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; EmailSubmitConnection = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;DirectCast&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.DataConnections(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Main submit&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;), EmailSubmitConnection)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39; Set To property to literal string value.&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;mySubmit.To.SetStringValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;someone@example.com&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39; Submit form.&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;mySubmit.Execute()&lt;/blockquote&gt;&lt;/font&gt;
&lt;p&gt;This code came from &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.xpathtypedvalue(VS.80).aspx"&gt;here&lt;/a&gt;, (with a minor typo fix) and it compiles and runs. However -- several things of note. &lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Main submit&amp;quot;&lt;/font&gt;&lt;/font&gt; needs&amp;nbsp;to be replaced with the name of your connection and there is no error handling. When the &amp;quot;pre-email&amp;quot; pop-up comes up in InfoPath, if I cancel sending the email, I&amp;#39;ll get an error. The EmailSubmitConnection members are &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.emailsubmitconnection_members(VS.80).aspx"&gt;here&lt;/a&gt; and I do see Introduction, so you should be able to place a field there...&lt;/p&gt;
&lt;p&gt;Hopefully this will get you started -- if you need help getting the value of a form field, look into XPathNavigator (or search here) and let me know if you get stuck, okay?&lt;/p&gt;</description></item><item><title>Re: DataAdapters syntax</title><link>https://www.infopathdev.com:443/forums/thread/30594.aspx</link><pubDate>Fri, 18 Jul 2008 22:13:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30594</guid><dc:creator>Michael Vasquez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30594.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30594</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;IP 2007&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Mike&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: DataAdapters syntax</title><link>https://www.infopathdev.com:443/forums/thread/30593.aspx</link><pubDate>Fri, 18 Jul 2008 20:46:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30593</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30593.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30593</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m sorry, I shouldn&amp;#39;t have abreviated. Are you using InfoPath 2003 or InfoPath 2007? &lt;/p&gt;</description></item><item><title>Re: DataAdapters syntax</title><link>https://www.infopathdev.com:443/forums/thread/30592.aspx</link><pubDate>Fri, 18 Jul 2008 20:40:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30592</guid><dc:creator>Michael Vasquez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30592.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30592</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Basically, what I am doing is to submit the form, not using code, to a SharePoint List, which I am doing now with success.&amp;nbsp; What I need to do is to email a confirmation email to a person requesting SharePoint training.&amp;nbsp; I can do that using the current data connection.&amp;nbsp; The problem is that the &amp;quot;To&amp;quot; field in the data connection sometimes uses the person&amp;#39;s email address as&amp;nbsp; firstname.lastname@company.com and somtimes the person&amp;#39;s email address is firstname.mi.lastname@company.com.&amp;nbsp; Big company and there are many instances that a person might have the same first and last name.&amp;nbsp; Also, in the body of the field, I cannot insert any variables.&amp;nbsp; The body has to be all text.&amp;nbsp; Well, I need to add the date of the SharePoint Training Class.&amp;nbsp; I have done that in the subject, but would want to add it in the body.&lt;/p&gt;&lt;p&gt;When you way &amp;quot;What version of IP are you using?&amp;quot;, what is that?&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;I am doing all this in VB.net and all the samples out there do not work.&amp;nbsp; They are either in JSript or C#.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Mike&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: DataAdapters syntax</title><link>https://www.infopathdev.com:443/forums/thread/30590.aspx</link><pubDate>Fri, 18 Jul 2008 19:24:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30590</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30590.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30590</wfw:commentRss><description>&lt;p&gt;Hi--&lt;/p&gt;
&lt;p&gt;Is there a reason you&amp;#39;ve set up a data connection to submit via email if you wish to submit using code? I&amp;#39;m just wondering --&amp;nbsp;did you have&amp;nbsp;changes you wanted to make outside of the capabilities of the built-in email submit? If so, what are they?&amp;nbsp;What version of IP are you using?&lt;/p&gt;</description></item><item><title>Re: DataAdapters syntax</title><link>https://www.infopathdev.com:443/forums/thread/30580.aspx</link><pubDate>Fri, 18 Jul 2008 16:51:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30580</guid><dc:creator>Michael Vasquez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30580.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30580</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Still does not work. and Microsoft&amp;#39;s samples are lame.&amp;nbsp; For example from their page.&lt;/p&gt;&lt;p&gt;Visual Basic(Usage)&lt;br /&gt;Dim instance as EmailAdapter&lt;br /&gt;Dim value as String&lt;br /&gt;&lt;br /&gt;value = instance.Subject&lt;br /&gt;instance.Subject = value&lt;/p&gt;&lt;p&gt;&amp;nbsp;Strange looking.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Other sample I found as an example: Dim oEmail As EmailAdapter = DirectCast(xDoc.DataAdapters(&amp;quot;Email Submit&amp;quot;), EmailAdapter)&amp;nbsp; and got &amp;quot;Object reference not set to an instance of an object error&amp;quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I am just trying to send an email using code.&amp;nbsp; Can it be that difficult in VB?&amp;nbsp; I have been working on this for three days.&amp;nbsp; This is frustrating.&amp;nbsp; There are no good samples.&amp;nbsp; All the samples I have seen do not work are are incomplete.&amp;nbsp; People have a tendency to give samples and they assume you are an expert in the code, so many of the samples don&amp;#39;t make sense.&amp;nbsp; Or when I try to use them, it seems incomplete.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks for your help anyway.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Mike&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description></item><item><title>Re: DataAdapters syntax</title><link>https://www.infopathdev.com:443/forums/thread/30564.aspx</link><pubDate>Fri, 18 Jul 2008 12:36:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30564</guid><dc:creator>chandrakanth</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30564.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30564</wfw:commentRss><description>&lt;p&gt;&amp;lt;p&amp;gt;&lt;/p&gt;
&lt;p&gt;Please perform the&amp;nbsp;&amp;quot;Type Casting&amp;quot; on (xDoc.DataAdapters(&amp;quot;Email Submit&amp;quot;)) then your problem will get solved.I can help you by writing the code only but sorry i dont have better knowledge on VB.net code. But i can give clear idea on what it is in C#.&lt;/p&gt;
&lt;p&gt;EmailAdapter oEmail =&amp;nbsp; (EmailAdapter)xDoc.DataAdapters(&amp;quot;Email Submit&amp;quot;);&lt;/p&gt;
&lt;p&gt;&amp;lt;/p&amp;gt;&lt;/p&gt;</description></item><item><title>DataAdapters syntax</title><link>https://www.infopathdev.com:443/forums/thread/30543.aspx</link><pubDate>Thu, 17 Jul 2008 17:23:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30543</guid><dc:creator>Michael Vasquez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30543.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30543</wfw:commentRss><description>&lt;p&gt;Need help in using the the XDocument.DataAdapters using VB.net&lt;/p&gt;&lt;p&gt;&amp;nbsp;Tried the following but keep getting errors.&lt;/p&gt;&lt;p&gt;Dim oEmail = XDocument&lt;/p&gt;&lt;p&gt;Dim xDoc = XDocument&amp;nbsp;&lt;/p&gt;&lt;p&gt;oEmail = xDoc.DataAdapters(&amp;quot;Email Submit&amp;quot;)&lt;/p&gt;&lt;p&gt;The error I get is &amp;quot;Object reference not set to an instance of an object.&amp;quot;&lt;/p&gt;&lt;p&gt;I do have a data connection called Email Submit.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;Trying to email my form using code.&amp;nbsp; Samples would help&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Mike&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>