Hi
Im having a strange problem. I have a routine that assemples several RichText fields in different documents into a new document, which is shown on the web.
This is working perfectly, but i also need to replace some of the words, and i cant make it work, so what am i doing wrong.
I have the basic code here:
dim session as new NotesSession
dim webdb as NotesDatabase, crmdb as NotesDatabase
dim view as NotesView
dim webdoc as NotesDocument, rtdoc as NotesDocument
dim rt_target as NotesRichTextItem, rt_source as NotesRichTextItem
dim rtrange as NotesRichTextRange
set webdb = session.currentDatabase
set crmdb = session.getDatabase(“…”)
set view = crmdb.getView(“…”)
set webdoc = webdb.createDocument
set rt_target = new NotesRichTextItem(webdoc, “Body”)
set rtdoc = view.getFirstDocument()
do while not rtdoc is nothing
set rt_source = rtdoc.getFirstItem(“Body”)
call rt_target.appendRtItem(rt_source)
set rtdoc = view.getNextDocument(rtdoc)
Loop
call rt_target.compact()
set rtrange = rt_target.createRange()
call rtrange.findAndReplace(“…”, “…”, …)
call webdoc.save(true, false)
Print “[http…/0/” + webdoc.universalID + “]”
’ Call ws.editDocument(true, webdoc) ’ only use in notes
(Its an agent invoked from the web)
When i use this code then the document is assempled and shown on web, but the fields are not translated. If i use the bottom line (ws.editDocument…) then the fields are translated just fine ???
Should i refresh something ???
Thanks
Jacob Hansen