<?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: Form send per E-Mail with a Button with Code behind - how?</title><link>https://www.infopathdev.com:443/forums/thread/61021.aspx</link><pubDate>Tue, 02 Nov 2010 19:05:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:61021</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/61021.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=61021</wfw:commentRss><description>Generally, when rules don&amp;#39;t work the way I expect they will, the problem is that a field is not the value I think it is. Add a rule to field:Number1 that will display its value when you change it, as well as actions to your submit rules to display the value of the field the conditions are based off of. This may help you see where your logic error is. Is the condition that the field is blank or the field is not blank? Or present or not present? I don&amp;#39;t see &amp;quot;empty&amp;quot; as an option when I try to set a rule condition.</description></item><item><title>Re: Form send per E-Mail with a Button with Code behind - how?</title><link>https://www.infopathdev.com:443/forums/thread/61008.aspx</link><pubDate>Tue, 02 Nov 2010 15:29:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:61008</guid><dc:creator>MarcoNB</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/61008.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=61008</wfw:commentRss><description>Anyone have an idea for me? I don&amp;#39;t get this rules working.</description></item><item><title>Re: Form send per E-Mail with a Button with Code behind - how?</title><link>https://www.infopathdev.com:443/forums/thread/60922.aspx</link><pubDate>Sun, 31 Oct 2010 18:31:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60922</guid><dc:creator>MarcoNB</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60922.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60922</wfw:commentRss><description>&lt;p&gt;O.K. thanks for comments so far.&lt;/p&gt;
&lt;p&gt;I know that a semicolon is not a typical sign for VB so I&amp;nbsp;had tried to remove the semicolon before, but then rest of the code is then also wrong and the whole row before the semicolon (&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;.Application.ActiveWindow.MailEnvelope). So that isn&amp;#39;t the solution.&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;Rules were that what I tried before I started to program a code solution. But I didn&amp;#39;t got that rules to work. Now where you mentioned to me, that rules should can handle 2 different data connections, I gave them another try. Sadly I don&amp;#39;t get my rules to work.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I only want a very very easy configuration.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&amp;nbsp;Rule 1:&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;IF&lt;/p&gt;
&lt;p&gt;&amp;nbsp;field:Number1&amp;nbsp;(from my Access-DB Data Fields) is&amp;nbsp;empty&lt;/p&gt;
&lt;p&gt;Then&amp;nbsp;Action&lt;/p&gt;
&lt;p&gt;Send to Data Connection - E-Mail&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Rule 2:&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;IF&lt;/p&gt;
&lt;p&gt;&amp;nbsp;field:Number1&amp;nbsp;(from my Access-DB Data Fields) is not&amp;nbsp;empty&lt;/p&gt;
&lt;p&gt;Then&amp;nbsp;Action&lt;/p&gt;
&lt;p&gt;Send to Data Connection - Database&lt;/p&gt;
&lt;p&gt;______&lt;/p&gt;
&lt;p&gt;Unless if the Field Number1 is empty or not, the form allways sends an email. I can&amp;#39;t&amp;nbsp;use the main data connection to my database.&lt;/p&gt;
&lt;p&gt;I tried&amp;nbsp;to change the order of the rules&amp;nbsp;processing. I tried to activate the checkboxes at &amp;quot;end the rules processing if this rule fits and was executed&amp;quot;. I tried a MsgBox instead of the E-Mail send, but then&amp;nbsp;if I have NOT a&amp;nbsp;number in my field, the message box appears and data is send to Access. But after getting the MsgBox, the rules should stop processing, because I activated the checkbox, and the rule for sending to Access is not true.&lt;/p&gt;
&lt;p&gt;I think something important must not be working with my rules, you have any ideas and suggestions for me please?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also further interessted to get the E-Mail send VB code for a formular.&lt;/p&gt;</description></item><item><title>Re: Form send per E-Mail with a Button with Code behind - how?</title><link>https://www.infopathdev.com:443/forums/thread/60883.aspx</link><pubDate>Fri, 29 Oct 2010 16:07:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60883</guid><dc:creator>Potemkine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60883.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60883</wfw:commentRss><description>&lt;p&gt;Hilary is right you probably set your button action to &amp;quot;Submit&amp;quot; if you set it to &amp;quot;rules and custom code&amp;quot;, you can set many submit rules&amp;nbsp;in this way.&lt;/p&gt;</description></item><item><title>Re: Form send per E-Mail with a Button with Code behind - how?</title><link>https://www.infopathdev.com:443/forums/thread/60879.aspx</link><pubDate>Fri, 29 Oct 2010 15:07:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60879</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60879.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60879</wfw:commentRss><description>Can&amp;#39;t you change your submit options to use rules and then use a rule to first submit to Access and a second rule to submit to your email connection? I really don&amp;#39;t think you need to write code for this.</description></item><item><title>Re: Form send per E-Mail with a Button with Code behind - how?</title><link>https://www.infopathdev.com:443/forums/thread/60875.aspx</link><pubDate>Fri, 29 Oct 2010 14:25:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60875</guid><dc:creator>Potemkine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60875.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60875</wfw:commentRss><description>&lt;p&gt;hi, first remove the semicolon, it&amp;#39;s not necessary on VB.&lt;/p&gt;</description></item><item><title>Form send per E-Mail with a Button with Code behind - how?</title><link>https://www.infopathdev.com:443/forums/thread/60871.aspx</link><pubDate>Fri, 29 Oct 2010 14:03:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60871</guid><dc:creator>MarcoNB</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60871.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60871</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have the following problem. I designed an Infopath form, with an Access-DB primary connection. Additionally I need to send this form per Button per E-Mail to a definied adress.&lt;/p&gt;
&lt;p&gt;With an Access-DB Connection as primary connection, I can&amp;#39;t use the normal E-Mail Connection from Infopath to send the form. (Only one send connection is allowed.)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;So I have to look to solve this problem with VB code.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I found at the following link this example:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/de-de/library/microsoft.office.infopath.mailenvelope.aspx"&gt;http://msdn.microsoft.com/de-de/library/microsoft.office.infopath.mailenvelope.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Code:&lt;/p&gt;
&lt;p&gt;Imports Microsoft.Office.InfoPath&lt;br /&gt;Imports System&lt;br /&gt;Imports System.Windows.Forms&lt;br /&gt;Imports System.Xml&lt;br /&gt;Imports System.Xml.XPath&lt;br /&gt;Imports mshtml&lt;br /&gt;Imports Microsoft.Office&lt;br /&gt;Imports Microsoft.VisualBasic&lt;br /&gt;Imports System.Web.Mail&lt;br /&gt;Imports System.Web&lt;/p&gt;
&lt;p&gt;Namespace VA&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Class FormCode&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub InternalStartup(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Startup&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddHandler EventManager.FormEvents.Submit, AddressOf FormEvents_Submit&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddHandler DirectCast(EventManager.ControlEvents(&amp;quot;CTRL16_7&amp;quot;), ButtonEvent).Clicked, AddressOf CTRL16_7_Clicked&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddHandler DirectCast(EventManager.ControlEvents(&amp;quot;CTRL27_4&amp;quot;), ButtonEvent).Clicked, AddressOf CTRL27_4_Clicked&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddHandler DirectCast(EventManager.ControlEvents(&amp;quot;CTRL28_4&amp;quot;), ButtonEvent).Clicked, AddressOf CTRL28_4_Clicked&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub FormEvents_Submit(ByVal sender As Object, ByVal e As SubmitEventArgs)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub CTRL16_7_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Form send with Mail&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;#39; Set a reference to MailEnvelope object.&lt;br /&gt;&amp;nbsp;&amp;nbsp;Dim myEnvelope As MailEnvelope&amp;nbsp; = _&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;Me.Application.ActiveWindow.MailEnvelope;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;#39; Check to see if form is open in Outlook.&lt;br /&gt;&amp;nbsp;&amp;nbsp;If (myEnvelope.Available) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;#39; Specify addresses, subject, and introduction.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;myEnvelope.To = &amp;quot;&lt;a href="mailto:someone@example.com"&gt;someone@example.com&lt;/a&gt;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;myEnvelope.CC = &amp;quot;&lt;a href="mailto:someone@example.com"&gt;someone@example.com&lt;/a&gt;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;myEnvelope.BCC = &amp;quot;&lt;a href="mailto:someone@example.com"&gt;someone@example.com&lt;/a&gt;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;myEnvelope.Subject = &amp;quot;Open this form&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;myEnvelope.Introduction = &amp;quot;InfoPath is required to edit this form.&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;#39; Include form template with form.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;myEnvelope.EmailAttachmentType = EmailAttachmentType.XmlXsn&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Display form with e-mail envelope.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;myEnvelope.Visible = True&lt;br /&gt;&amp;nbsp;&amp;nbsp;Else&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;#39; The form is open in Outlook, and code will not run.&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;MessageBox.Show(&amp;quot;This form is open in Outlook.&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;End If&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Class&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;Deklaration&lt;br /&gt;&amp;nbsp;&amp;nbsp; Public MustInherit Class MailEnvelope&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim instance As MailEnvelope&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Class&lt;/p&gt;
&lt;p&gt;End Namespace&lt;/p&gt;
&lt;p&gt;==========================================&lt;/p&gt;
&lt;p&gt;==========================================&lt;/p&gt;
&lt;p&gt;==========================================&lt;/p&gt;
&lt;p&gt;The first problem ist the semicolon (;) at&lt;/p&gt;
&lt;p&gt;Me.Application.ActiveWindow.MailEnvelope;&lt;/p&gt;
&lt;p&gt;which gets a blue underscore for a code failiure&lt;/p&gt;
&lt;p&gt;Then all the myEnvelope variables have also a blue underscore.&lt;/p&gt;
&lt;p&gt;____________________________________________________&lt;/p&gt;
&lt;p&gt;I tried a lot of things, but I don&amp;#39;t get rid of this code failiures. Now I have 8 hours of try&amp;#39;n behind me and hope someone can help me here with this Visual Basic Class. I only want to send the actual form with all user made entrys to an E-Mail adress.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Marco&lt;/p&gt;</description></item></channel></rss>