<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lotushints &#187; Rich Text Item</title>
	<atom:link href="http://www.lotushints.com/tag/rich-text-item/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lotushints.com</link>
	<description>Lotus Notes tips &#38; tricks you always hoped you will not need</description>
	<lastBuildDate>Wed, 14 Jul 2010 06:00:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Adding content to Rich Text field in a document using QOA</title>
		<link>http://www.lotushints.com/2008/12/adding-content-to-rich-text-field/</link>
		<comments>http://www.lotushints.com/2008/12/adding-content-to-rich-text-field/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 08:00:33 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Basic]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[LotusScript]]></category>
		<category><![CDATA[Rich Text Item]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=154</guid>
		<description><![CDATA[I have found an interesting challenge last week. For some reason, I had to have a document on web that would show a computed table of products and there would be some content before and after. The trick however is, that we use some sort of CRM database for our web content and documents use [...]]]></description>
			<content:encoded><![CDATA[<p>I have found an interesting challenge last week. For some reason, I had to have a document on web that would show a computed table of products and there would be some content before and after. The trick however is, that we use some sort of CRM database for our web content and documents use one rich text item to store document content.</p>
<p>Now, I didn&#8217;t want to create another form or change the existing one and there was way to complicated to do a computed value in rich text for table display. And we already had a web <abbr title="Query open Agent">QOA</abbr> for this type of document.<span id="more-154"></span>So what did I do? I added following custom code to rich text field:</p>
<pre>&lt;$$myTable&gt;</pre>
<p><strong>But how would that do you any good?</strong></p>
<p>Now all I had to do is add the following code to <abbr title="Query open Agent">QOA</abbr>:</p>
<pre>Dim rti As NotesRichTextItem
dim rtr As NotesRichTextRange
...
Set rti = docWeb.GetFirstItem ("Body")
Set rtr = rti.CreateRange
Call rtr.FindAndReplace ({&lt;$$myTable&gt;}, strHtml)
Call rti.Compact ();
...</pre>
<p>First I obtain a Rich Text field where my identifier is. Then, I created a range and used <a href="http://publib-b.boulder.ibm.com/lotus/c2359850.nsf/f4b82fbb75e942a6852566ac0037f284/34518440ca28e24d8525731b004a59f1?OpenDocument">FindAndReplace</a> method to replace identifier with HTML (stored in strHtml variable), that will display required table.</p>
<p><strong>That is all?</strong></p>
<p>Yes. Mind you, there is a catch. All in-line images in Rich Text field will not display on web. Image resources will display normally.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2008/12/adding-content-to-rich-text-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
