<?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: MailEnvelope / populating Subject with form data</title><link>https://www.infopathdev.com:443/forums/thread/78466.aspx</link><pubDate>Thu, 10 May 2012 15:54:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:78466</guid><dc:creator>sezdar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/78466.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=78466</wfw:commentRss><description>&lt;p&gt;in relation to this - I was wondering if there is a way to make the subject field on the MailEnvelope Read only.&lt;/p&gt;
&lt;p&gt;I have my users submitting the forms however I would like them to stop amended the Subject field on the emails. (sorry if its a simple answer but I am not well adept at coding)&lt;/p&gt;</description></item><item><title>Re: MailEnvelope / populating Subject with form data</title><link>https://www.infopathdev.com:443/forums/thread/15161.aspx</link><pubDate>Mon, 12 Mar 2007 16:03:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15161</guid><dc:creator>ablinn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15161.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15161</wfw:commentRss><description>Thanks nukkumatti.&lt;br /&gt;&lt;br /&gt;I tried the approach you suggested but I couldn't get it to work. It's very possible that it's because I am not knowledgable enough with coding. I also tried several other approaches that I read online on various sites, and I couldn't get any of them to work either. However, I found an approach in the InfoPath 2003 SDK documentation that seemed to work great. Using the Source property, I was able to populate the Subject field of the e-mail message with node values from my form.&lt;br /&gt;&lt;br /&gt;I also tried to understand the purpose of each line, and after testing the code I was able to eliminate several lines.&lt;br /&gt;&lt;br /&gt;&lt;font color="blue"&gt;function CreateMailEnvelope::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;var oEnvelope = Application.ActiveWindow.MailEnvelope; &lt;br /&gt;oEnvelope.To = "DL name or e-mail address A; DL name or e-mail address B";&lt;br /&gt;oEnvelope.CC = "DL name or e-mail address C";&lt;br /&gt;oEnvelope.Visible = true; &lt;br /&gt;oEnvelope.Subject = eventObj.Source.selectSingleNode("//my:ForReview").text + eventObj.Source.selectSingleNode("//my:DocumentTitle").text;&lt;br /&gt;&lt;br /&gt;var objView;&lt;br /&gt;objView = XDocument.Mail;&lt;br /&gt;XDocument.View.SwitchView("mail");&lt;br /&gt;}&lt;/font id="blue"&gt;&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: MailEnvelope / populating Subject with form data</title><link>https://www.infopathdev.com:443/forums/thread/15160.aspx</link><pubDate>Thu, 08 Mar 2007 06:51:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15160</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15160.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15160</wfw:commentRss><description>Question. Are FORREVIEW and DocumentTitle the names of your controls within your Infopath form ?&lt;br /&gt;&lt;br /&gt;If yes then in code you have to use something like this:&lt;br /&gt;&lt;br /&gt;IXMLDOMNode myForReview = XDocument.Dom.SelectSingleNode("my:myFields/my:FORREVIEW")&lt;br /&gt;&lt;br /&gt;and then in your subject you can use myForReview.text</description></item><item><title>MailEnvelope / populating Subject with form data</title><link>https://www.infopathdev.com:443/forums/thread/13078.aspx</link><pubDate>Wed, 07 Mar 2007 14:51:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13078</guid><dc:creator>ablinn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13078.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13078</wfw:commentRss><description>I am using MailEnvelope to embed an InfoPath form into an e-mail message. (There are people outside my network who need access to the form.)&lt;br /&gt;&lt;br /&gt;When the mail form opens, I want to automatically populate the Subject with two fields from the InfoPath form. Is this possible?&lt;br /&gt;&lt;br /&gt;Here's my current code:&lt;br /&gt;&lt;br /&gt;&lt;font color="blue"&gt;&lt;font face="Courier New"&gt;function CTRL44_5::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt; createEmail();&lt;br /&gt;}&lt;br /&gt; function createEmail()&lt;br /&gt;{ &lt;br /&gt; var xmlContributors = XDocument.DOM.selectNodes("my:template"); &lt;br /&gt; var xmlContributor; &lt;br /&gt; var rgRecipients = new Array(); &lt;br /&gt; while (xmlContributor = xmlContributors.nextNode()&lt;br /&gt;) &lt;br /&gt;rgRecipients.push(getNodeValue(xmlContributor.selectSingleNode("my:To"))); &lt;br /&gt;try &lt;br /&gt;{&lt;br /&gt; var oEnvelope = XDocument.View.Window.MailEnvelope; &lt;br /&gt; oEnvelope.To = "ablinn@omtool.com";&lt;br /&gt;&lt;font color="green"&gt;//This is where I need help. The titles of the two form fields are listed below. (In my form, they're both text boxes.) When I try running anything with the name of a field, I get an "undefined" error. I'm not a coder by trade so please err on the side of extra detail.&lt;/font id="green"&gt;&lt;br /&gt; oEnvelope.Subject = FORREVIEW.text + DocumentTitle.text;&lt;br /&gt; oEnvelope.Visible = true; &lt;br /&gt;} &lt;br /&gt;catch (ex) &lt;br /&gt;{&lt;br /&gt; XDocument.UI.Alert(ex.description);&lt;br /&gt; } &lt;br /&gt;}&lt;/font id="Courier New"&gt;&lt;/font id="blue"&gt;</description></item></channel></rss>