<?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: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31441.aspx</link><pubDate>Wed, 13 Aug 2008 15:54:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31441</guid><dc:creator>Will Dieterich</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31441.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31441</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Since you are just using the values of a drop down list and not fancy images,etc how about dropping the rich text and just going with a text box.&amp;nbsp; The standard text box can be made multi-line and it is alot easier to add text and the text added keeps newlines, spaces,etc.&lt;/p&gt;&lt;p&gt;&amp;nbsp;As for the problem of items going on the same line you are probably not creating a new object and changing the value of the existing innertext.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31218.aspx</link><pubDate>Wed, 06 Aug 2008 08:47:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31218</guid><dc:creator>ben.oates</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31218.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31218</wfw:commentRss><description>&lt;p&gt;Hi dlocc,&lt;/p&gt;
&lt;p&gt;Without seeing your code I&amp;#39;m going to have to imagine you have been careful to make sure it is identical, but have you checked the Properties of the Rich Text Box? Under the display tab I believe there is a paragraph breaks tick box that may not have a tick in it.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Ben&lt;/p&gt;</description></item><item><title>Re: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31214.aspx</link><pubDate>Wed, 06 Aug 2008 00:42:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31214</guid><dc:creator>dlocc</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31214.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31214</wfw:commentRss><description>&lt;p&gt;Hello again, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;sorry to keep this thread going, but I have another problem... when I use the above code on a new form with just a rich text box field, a button, and a drop down list it works perfectly.&amp;nbsp; The fields are added like so:&lt;/p&gt;
&lt;p&gt;Line 1&lt;/p&gt;
&lt;p&gt;Line 2&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But when I try to implement the same exact rich text box, drop down, button and code in an already existing form the items do not add line breaks so the data displays side-by-side:&lt;/p&gt;
&lt;p&gt;&amp;quot;Line 1Line 2Line 1Line 2Line 1Line 2&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;No idea why this is happening... any advice is appreciated as always. :]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31211.aspx</link><pubDate>Tue, 05 Aug 2008 18:45:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31211</guid><dc:creator>dlocc</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31211.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31211</wfw:commentRss><description>&lt;p&gt;Awesome, thanks a lot! I got it working!&lt;/p&gt;</description></item><item><title>Re: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31210.aspx</link><pubDate>Tue, 05 Aug 2008 18:37:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31210</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31210.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31210</wfw:commentRss><description>&lt;p&gt;.Value for IP2007 Object Model, instead of .Text&lt;/p&gt;</description></item><item><title>Re: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31209.aspx</link><pubDate>Tue, 05 Aug 2008 18:29:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31209</guid><dc:creator>dlocc</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31209.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31209</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XPathNavigator nav = MainDataSource.CreateNavigator();&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; XPathNavigator rtfNav = nav.SelectSingleNode(&amp;quot;//my:rtfField&amp;quot;, NamespaceManager);&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; using (XmlWriter rtfWriter = rtfNav.AppendChild())&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; {&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtfWriter.WriteStartElement(&amp;quot;div&amp;quot;, &amp;quot;&lt;a href="http://www.w3.org/1999/xhtml"&gt;http://www.w3.org/1999/xhtml&lt;/a&gt;&amp;quot;);&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtfWriter.WriteString(nav.SelectSingleNode(&amp;quot;//my:Actions&amp;quot;, NamespaceManager).Text);&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtfWriter.WriteEndElement();&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtfWriter.WriteStartElement(&amp;quot;div&amp;quot;, &amp;quot;&lt;a href="http://www.w3.org/1999/xhtml"&gt;http://www.w3.org/1999/xhtml&lt;/a&gt;&amp;quot;);&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtfWriter.WriteString(&amp;quot;Line 2&amp;quot;);&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtfWriter.WriteEndElement();&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtfWriter.Close();&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; } &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;here is the code I am using, I get a build error and it says the &amp;quot;.Text&amp;quot; does not contain a value... and comes back underlined in VSTA&lt;/p&gt;</description></item><item><title>Re: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31204.aspx</link><pubDate>Tue, 05 Aug 2008 16:11:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31204</guid><dc:creator>dlocc</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31204.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31204</wfw:commentRss><description>&lt;p&gt;Thanks for the prompt reply, I think I know how to tackle this problem now... I will post the final code (hopefully) when I get it working.&amp;nbsp; If not, maybe another question :]&lt;/p&gt;</description></item><item><title>Re: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31203.aspx</link><pubDate>Tue, 05 Aug 2008 16:04:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31203</guid><dc:creator>ben.oates</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31203.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31203</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t have 2007 so I can&amp;#39;t send you an exact example of what you would be looking for, but you have already navigated to a node with the following line:&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;XPathNavigator rtfNav = nav.SelectSingleNode(&amp;quot;//my:rtfField&amp;quot;, NamespaceManager);&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So what you would need to do is set the address of your drop down box in the place of your &amp;quot;//my:rtfField&amp;quot; option and then use Text or Value to get its content.&lt;/p&gt;
&lt;p&gt;If you still get an error, break out and add a watch on nav.select etc. and find out what the name of the value is.&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;rtfWriter.WriteString(nav.SelectSingleNode(&amp;quot;//my:dropDownListField&amp;quot;, NamespaceManager).Text);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Remember that JScript/C# etc.&amp;nbsp;are case sensitive... I don&amp;#39;t know if SelectSingleNode or Text should start with lower case letters and I don&amp;#39;t know if Text should be Value etc.. You&amp;#39;ll have to work that out if you get an error saying the method isn&amp;#39;t available.&lt;/p&gt;</description></item><item><title>Re: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31202.aspx</link><pubDate>Tue, 05 Aug 2008 15:47:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31202</guid><dc:creator>dlocc</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31202.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31202</wfw:commentRss><description>&lt;p&gt;Hello Ben Oates,&lt;/p&gt;
&lt;p&gt;The drop down would be outsite of the rich text box.&amp;nbsp; So basically, whenever someone selects a value in the drop down and clicks the buton it adds the text to the rich text box.&amp;nbsp; I know it&amp;#39;s a simple code solution, and it sounds like replacing the &amp;quot;line 1&amp;quot; with .Text value.&amp;nbsp; I have some idea how to do this, but I have always been getting errors... do you have a code example I could go from or some tips?&amp;nbsp; Thanks again.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31195.aspx</link><pubDate>Tue, 05 Aug 2008 12:51:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31195</guid><dc:creator>ben.oates</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31195.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31195</wfw:commentRss><description>I don&amp;#39;t quite understand. Would the drop down list be inside or outside of the rich text box? If it&amp;#39;s outside, you would just replace &amp;quot;Line 1&amp;quot; with a .Text value from the node or attribute associated with the drop down box a similar way to what you have done for rtfNav.&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;I would imagine that to be the case.&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Add a field's value when new line is created....</title><link>https://www.infopathdev.com:443/forums/thread/31072.aspx</link><pubDate>Thu, 31 Jul 2008 17:01:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31072</guid><dc:creator>dlocc</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31072.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31072</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have followed along with the following tutorial showing how to add lines of text to a rich text box here: &lt;a href="http://enterprise-solutions.swits.net/blog/?p=26#comment-282"&gt;http://enterprise-solutions.swits.net/blog/?p=26#comment-282&lt;/a&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;the code works great and adds the text &amp;quot;Line 1&amp;quot; and &amp;quot;Line 2&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;XPathNavigator nav = MainDataSource.CreateNavigator();&lt;br /&gt;XPathNavigator rtfNav = nav.SelectSingleNode(&amp;quot;//my:rtfField&amp;quot;, NamespaceManager);&lt;br /&gt;using (XmlWriter rtfWriter = rtfNav.AppendChild())&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; rtfWriter.WriteStartElement(&amp;quot;div&amp;quot;, &amp;quot;http://www.w3.org/1999/xhtml&amp;quot;);&lt;br /&gt;&amp;nbsp; rtfWriter.WriteString(&amp;quot;Line 1&amp;quot;);&lt;br /&gt;&amp;nbsp; rtfWriter.WriteEndElement();&lt;br /&gt;&amp;nbsp; rtfWriter.WriteStartElement(&amp;quot;div&amp;quot;, &amp;quot;http://www.w3.org/1999/xhtml&amp;quot;);&lt;br /&gt;&amp;nbsp; rtfWriter.WriteString(&amp;quot;Line 2&amp;quot;);&lt;br /&gt;&amp;nbsp; rtfWriter.WriteEndElement();&lt;br /&gt;&amp;nbsp; rtfWriter.Close();&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;What I need though is to have the value of a Drop Down List show instead of the text &amp;quot;Line 1&amp;quot;.&amp;nbsp; So when a user selects the value in the drop down and clicks the button it adds the value to the new line?&amp;nbsp; Get it?&amp;nbsp; Let me know if you have any questions. Thanks!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>