Ben Langhinrichs

Photograph of Ben Langhinrichs

E-mail address - Ben Langhinrichs






September, 2005
SMTWTFS
    01 02 03
04 05 06 07 08 09 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30

Search the weblog





























Genii Weblog


Civility in critiquing the ideas of others is no vice. Rudeness in defending your own ideas is no virtue.


Thu 1 Sep 2005, 04:53 PM
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 If
End Sub

Copyright © 2005 Genii Software Ltd.

Thu 1 Sep 2005, 10:29 AM
I was amused to see WYSIWYG defined on the Word of the Day calendar that my wife has in our kitchen.  We both have very good vocabularies, so it is common when we see a word we don't recognize to ask if the other knows it.  So my wife asked if I was familiar with WYSIWYG, and I had to laugh.  Because of our Web Editors (list of WYSISYG editors for using rich text web editing) our website is on the first page when searching through at least some search sites.  So, yes, I have heard of WYSIWYG.

Copyright © 2005 Genii Software Ltd.