<?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: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/72357.aspx</link><pubDate>Fri, 25 Nov 2011 03:55:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:72357</guid><dc:creator>Nhhome</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/72357.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=72357</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I saw this in other tread http://www.infopathdev.com/forums/t/5780.aspx&lt;/p&gt;&lt;p&gt;&amp;nbsp;It is working like charm!!!!!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;function OpenMailEnvelop(subject, to)&lt;br /&gt;&lt;/p&gt;&lt;div&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;var 
oEnvelope = Application.ActiveWindow.MailEnvelope;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;oEnvelope.Subject = subject;&lt;br /&gt;&amp;nbsp;&amp;nbsp;oEnvelope.To = 
to;&lt;br /&gt;&amp;nbsp;&amp;nbsp;oEnvelope.Visible = true;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch(exception)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
return false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;function btnSomeButton::OnClick(eventObj)&lt;br /&gt;{&lt;/div&gt;
&lt;div&gt;&amp;nbsp; OpenMailEnvelop(&amp;quot;this is the subject&amp;quot;, &amp;quot;&lt;a href="mailto:someone@somewhere.com"&gt;someone@somewhere.com&lt;/a&gt;&amp;quot;)&lt;/div&gt;
&lt;div&gt;}&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/70573.aspx</link><pubDate>Fri, 23 Sep 2011 16:30:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70573</guid><dc:creator>gdgonzal</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70573.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=70573</wfw:commentRss><description>&lt;p&gt;Can you please share how you did this using JScript?&lt;/p&gt;</description></item><item><title>Re: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/66961.aspx</link><pubDate>Tue, 31 May 2011 14:05:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66961</guid><dc:creator>kaushik.mazumdar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66961.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66961</wfw:commentRss><description>&lt;p&gt;Gary,&lt;/p&gt;
&lt;p&gt;Thanks for your response, I shall search the site and hope to find something.... &lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Kaushik&lt;/p&gt;</description></item><item><title>Re: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/66960.aspx</link><pubDate>Tue, 31 May 2011 13:40:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66960</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66960.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66960</wfw:commentRss><description>&lt;p&gt;Kaushik&lt;/p&gt;
&lt;p&gt;Just search the site for &amp;quot;IF statement&amp;quot; &lt;/p&gt;
&lt;p&gt;It can be done using code or using Rules and Conditional Formatting.&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item><item><title>Re: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/66958.aspx</link><pubDate>Tue, 31 May 2011 13:24:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66958</guid><dc:creator>kaushik.mazumdar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66958.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66958</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Gary, Thanks for your help so far, just wanted to understand another thing for now - is there a post / example around using IF statements in InfoPath 2003?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Kaushik&lt;/p&gt;</description></item><item><title>Re: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/66956.aspx</link><pubDate>Tue, 31 May 2011 12:11:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66956</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66956.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66956</wfw:commentRss><description>&lt;p&gt;Kaushik&lt;/p&gt;
&lt;p&gt;Sorry but I don&amp;#39;t know how to do this in JScript. The code in the previous replies should be enough, with the addition of&lt;/p&gt;
&lt;p&gt;oEnvelope.CC&lt;/p&gt;
&lt;p&gt;It is simple enough to create a variable to extract the value of the TO and CC fields from a textbox in your form. A search of the site will bring up plenty of examples.&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item><item><title>Re: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/66955.aspx</link><pubDate>Tue, 31 May 2011 12:00:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66955</guid><dc:creator>kaushik.mazumdar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66955.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66955</wfw:commentRss><description>&lt;p&gt;Thanks Gary for your response...&lt;/p&gt;
&lt;p&gt;But i can see that am using JScript for my form, could you help me with the same code in JS? And would it be possible to have TO and CC fields be picked up from the form?&lt;/p&gt;
&lt;p&gt;Your help is much appreciated.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Kaushik&lt;/p&gt;</description></item><item><title>Re: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/66953.aspx</link><pubDate>Tue, 31 May 2011 11:35:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66953</guid><dc:creator>GazM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66953.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66953</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Try this VBScript. It works with my Infopath 2003 forms. The form is attached to the email as well as displaying in the body of the email.&lt;/p&gt;
&lt;p&gt;Sub btnSend_OnClick(eventObj)&lt;/p&gt;
&lt;p&gt;Dim myEnvelope&lt;/p&gt;
&lt;p&gt;set myEnvelope = Application.ActiveWindow.MailEnvelope&lt;/p&gt;
&lt;p&gt;&amp;#39; Specify addresses, subject, and introduction.&lt;/p&gt;
&lt;p&gt;myEnvelope.To = &lt;a href="mailto:someone@example.com"&gt;someone@example.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;#39;myEnvelope.CC = &lt;a href="mailto:someone@example.com"&gt;someone@example.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;#39;myEnvelope.BCC = &lt;a href="mailto:someone@example.com"&gt;someone@example.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;myEnvelope.Subject = &amp;quot;subject text here&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;#39;myEnvelope.Introduction = &amp;quot;text here if required&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;#39; Include form template with form.&lt;/p&gt;
&lt;p&gt;myEnvelope.EmailAttachmentType = EmailAttachmentType.XmlXsn&lt;/p&gt;
&lt;p&gt;&amp;#39; Display form with e-mail envelope.&lt;/p&gt;
&lt;p&gt;myEnvelope.Visible = True&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;</description></item><item><title>Re: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/66948.aspx</link><pubDate>Tue, 31 May 2011 07:08:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66948</guid><dc:creator>kaushik.mazumdar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66948.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66948</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;Hi i am fairly new here... and couldn&amp;#39;t get this to work. Could you please help me show how to do this step-by-step? Thanks, Kaushik</description></item><item><title>Re: Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/41845.aspx</link><pubDate>Mon, 18 May 2009 18:01:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41845</guid><dc:creator>shaan_mm</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41845.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41845</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I implemented this just yesterday, but in JScript. You may want try out the &amp;#39;MailEnvelope&amp;#39; object. I do not know if it is available through VBScript or not. Just in case it helps or gives you a new direction, I would be more than happy.&lt;/p&gt;
&lt;p&gt;var oEnvelope = Application.ActiveWindow.MailEnvelope;&lt;/p&gt;
&lt;p&gt;oEnvelope.Subject = &amp;quot;hello&amp;quot;;&lt;/p&gt;
&lt;p&gt;oEnvelope.To = &lt;a href="mailto:email@gmail.com"&gt;email@gmail.com&lt;/a&gt;;&lt;/p&gt;
&lt;p&gt;oEnvelope.Visible = true;&lt;/p&gt;
&lt;p&gt;love-n-peace,&lt;/p&gt;
&lt;p&gt;~shaan&lt;/p&gt;</description></item><item><title>Submit current view via email for InfoPath 2003 users</title><link>https://www.infopathdev.com:443/forums/thread/40372.aspx</link><pubDate>Mon, 06 Apr 2009 23:51:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40372</guid><dc:creator>Passthepuck</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40372.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40372</wfw:commentRss><description>&lt;p&gt;For some time now, I have been on the hunt for a solution to allow InfoPath 2003 users to submit the current view (not the default view) of a form via email (Outlook) without it sending as an attachment.&amp;nbsp; From what I am learning, there is&amp;nbsp;a certain script or code that I can apply to the submit button (command) that will send the &lt;strong&gt;&lt;em&gt;current view&lt;/em&gt;&lt;/strong&gt; of the form in the &lt;strong&gt;&lt;em&gt;body of the email&lt;/em&gt;&lt;/strong&gt;.&amp;nbsp; I really don&amp;#39;t know a thing about VB Script besides basic Excel stuff.&amp;nbsp; The code that others have posted is great and all, but I need to go back a step or two to actually walk through the steps of where to post the script or code. And if I need to change it to fit my application at all.&lt;/p&gt;
&lt;p&gt;I have enabled Microsoft Visual Studio Tools for Application (MVSTA) in InfoPath (I am working in InfoPath 2007).&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In design mode/view, when I&amp;nbsp;click on &amp;quot;Edit Form Code&amp;quot;&amp;nbsp;in Button Properties window of the submit button, it opens MVSTA and notes &amp;quot;Write your code here.&amp;quot; under the &amp;quot;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Public&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;Sub&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; FormEvents_Submit(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender &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; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Object&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;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e &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; SubmitEventArgs)&amp;quot; section.&amp;nbsp; Is this where I would type in (or paste) the code?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;In addition to learning where to post the script, I need the specific script information that will make this work.&amp;nbsp; Preferably, I would like to copy what someone gives me and paste it in whatever area it goes and then close the window.&amp;nbsp; If there is anything else needed, I need specific instructions of what to alter or further customize.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;strong&gt;&lt;u&gt;If it helps, here is my application:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;My company has not transitioned everyone to MS Office 2007 yet, which means even though I build 2003 forms using InfoPath 2007, the users will be submitting the forms via 2003.&amp;nbsp; The forms that I&amp;#39;m creating have different views because each view is sent to a different group of people.&amp;nbsp; I can adjust the Email Submit data connection settings to &amp;quot;Send only the active view of the form and no attachment,&amp;quot; but that results in a blank email sent from 2003 users.&amp;nbsp; The moment I change the setting so that 2003 users can submit it as an attachment, they lose the ability to send the current view (meaning the view that is sent/attached is the default view of the form).&amp;nbsp; I have a couple of different forms and different applications, and my problem stems from needing to be able to have 2003 users submit a form that captures the current view and sends it in the body of the email instead of as an attachment.&amp;nbsp; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;font size="2"&gt;In a perfect world, I would tell everyone to catch up and update their programs to Office 2007!&amp;nbsp; Only I haven&amp;#39;t the ability or authority to do so.&amp;nbsp; I&amp;#39;m so close, and everything else in InfoPath&amp;nbsp;has been within my reach (having little technical experience), but I need help going the rest of the way.&amp;nbsp; I know it&amp;#39;s possible.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;Thanks in advance for any help or assistance!&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>