There was a post on the Gold forum where a person asked:<blockquote>I've got one document with a table (1000 rows) and I want to transfer this table into 1000 single documents. Each row one document. I get the table and the cells with a NotesRichTextNavigator. With normal text it is ok, but when I have a cell with an embedded image, I don't get the image.
If the cell has a doclink, I get the doclink with FindFirstElement(RTELEM_TYPE_DOCLINK), but how do I get an image?
Any ideas?</blockquote>Doug Cohen who works for SUNY (State University of New York) suggested that the person try our Midas Rich Text LSX. He did, and I just wanted to share this code, which is the sample I created which does the job even more easily than I had thought. The following code works even if (as I created in the sample) there are doclinks, images and nested tables. Pretty good for 35 lines of code, wouldn't you agree. I am putting this up as a sample database on our website tomorrow if anybody wants to try it out. Look for the
Parse Table sample. Oh, and thanks to Doug Cohen! We depend on people like Doug for word of mouth recommendations, and we appreciate them immensely when they are given publicly like this,
Sub Initialize
' *** Domino class objects Dim session
As New NotesSession
Dim db
As NotesDatabase
Dim doc
As NotesDocument
Dim newdoc
As NotesDocument
' *** Midas
class objects
Dim rtitem
As New GeniiRTItem
Dim rtchunk
As GeniiRTChunk
Dim rtchunk2
As GeniiRTChunk
Dim new_rtitem
As New GeniiRTItem
Dim new_rtchunk
As GeniiRTChunk
' *** Cycle through each row on the rich text, creating a new document for each and then ' *** appending the chunk which
is inside the table cell.
Set db
= session.CurrentDatabase
Set doc
= session.DocumentContext
Call rtitem.ConnectBackend
(doc.Handle
, "Body"
, False) If rtitem.IsConnected
Then Set rtchunk
= rtitem.DefineChunk
("Table 1; Row 1"
) While rtchunk.Exists
Set rtchunk2
= rtchunk.DefineSubChunk
("Inside Column 1"
) Set newdoc
= New NotesDocument
(db
) newdoc.Form
= "Example Form"
Call new_rtitem.CreateBackend
(newdoc.Handle
, "Body"
) Set new_rtchunk
= new_rtitem.DefineChunk
("Everything"
) newdoc.Subject
= doc.Subject
(0
) + "
(contents of "+rtchunk.Definition+"
)"
Call new_rtchunk.AppendRTChunk
(rtchunk2
) new_rtitem.Save
rtchunk.GetNextTarget
Wend End IfEnd SubCopyright © 2005 Genii Software Ltd.