Hi,
I have a web application that displays an RTF that it gets from a dblookup, but it loses its formatting, no suprizes there.
I am using a simple “Computed Text” on the web form :
q := @DbLookup(“”; “”; “My View”; “My Key”; 2;[PartialMatch]);
@Implode(@Text(q))
(i am using @abstract to display the rtf in “My View”)
What i want to know is : How can i populate one RTF field from another RTF and retain the formatting ??
Any help of pointers very welcome…
Regards Rob
Subject: RE: Preserve Rich Text Format. - How ?
Read the field not from the view, but from the document using the field name.And of course, don’t use @Text on it.
But you may have a problem doing this in formula if you’re trying to read from multiple documents. I don’t believe multivalued rich text will work. In that case you may have to do it with LotusScript, e.g. WebQueryOpen event and use NotesRichTextItem methods.
Subject: RE: Preserve Rich Text Format. - How ?
WebQueryOpen and use NotesRichTextItem,
this appears to be the only option open to me…
do you know of any snippets i could use ??
I know the field/document name/view to extract, but am getting a little lost in the coding…
Subject: RE: Preserve Rich Text Format. - How ?
See AppendRTItem.See also GetAllDocumentsByKey. If you need them in view order you may have to use the NotesViewNavigator class instead.
I don’t have a sample handy, but this is pretty straightforward. You remove the current rich text item if any, create a new one, and as you iterate thru the documents containing the information you want, get their rich text item and call AppendRTItem for each. You may want to use Update method or Compact at the end.
Subject: Preserve Rich Text Format. - How ?
Subject: RE: Preserve Rich Text Format. - How ?
Doc A is saved with the RTF Field
Doc B has a web query open , with the following code.
I am attempting to populate an RTF field “Topic_Month” with “Topic_Month” from Doc A
Dim sessCur As NotesSession
Dim db As NotesDatabase
Dim docCur As NotesDocument
Dim doc As NotesDocument
Dim view As NotesView
Set sessCur = New NotesSession
Set db = sessCur.CurrentDatabase
Set docCur = sessCur.DocumentContext
Dim rtext As notesrichtextitem
Dim rtextold As notesrichtextitem
Set view = db.GetView ("srch2" )
Set doc = view.GetDocumentByKey ("Topic of the Month" ,True)
Set Topic_Month= New NotesRichTextITem(docCur,"Topic_Month")