I have a RT Field and inside a computed text with a value.I need get the value of the computed text with Lotusscript.
Any sugestion?
Thanks.
I have a RT Field and inside a computed text with a value.I need get the value of the computed text with Lotusscript.
Any sugestion?
Thanks.
Subject: RE: Computed text inside RT Field
I don’t think you’ll be able to do that. I don’t think the value is stored in the rich text. You could open the rich text item using the C API (or a third-party tool that employs the C API, e.g. midas LSX from www.geniisoft.com) and discover what its formula is, then use Evaluate to execute the formula.
Subject: RE: Computed text inside RT Field
Andre is correct. If I were using our Midas Rich Text LSX, I would use code something like :
Set rtchunk = rtitem.DefineChunk(“ComputedText 1”)
the_formula = rtchunk.ActionFormula
the_result = Evaluate(the_formula, doc)
Now, one other possible way without a third party tool might be to render the rich text using RenderToRTITem and find the computed text by context within the rendered result. It depends on whether you know the context well enough.
Subject: Computed text inside RT Field
Here is sample code, where doc is the NotesDocument you want to get at, and is declared in (Declarations) so that both parts of the code can use it:
Dim dxp As NotesDXLExporter
Set dxp = session.CreateDXLExporter(doc)
Dim par As NotesDOMParser
Set par = session.CreateDOMParser(dxp)
On Event PostDOMParse From par Call ProcessDOM
dxp.Process
Sub ProcessDOM(Source As NotesDOMParser)
Dim items As NotesDOMNodeList
Set items = Source.Document.GetElementsByTagName("computedtext")
For i& = 1 To items.NumberOfEntries
Dim ctxt As NotesDOMElementNode
Set ctxt = items.GetItem(i&)
E = Evaluate(ctxt.FirstChild.FirstChild.FirstChild.NodeValue, doc)
Messagebox E(0)
Next
End Sub