|
I am a bit puzzled by your question and the code. When I look at the code, there is nothing there that shows me you are composing a new document. In fact, you are copying the RichTextItem to the backend class of the current UIdocument. Doing so can even cause save-conflicts, as you are working on both instances at the same time.
The following is some sample code, which shows you how to copy an RTF field to another document and then open that document in edit mode to the user. Hope this will help.
Dim s As New notesSession
Dim w As New notesUIWorkspace
Dim myDb As notesDatabase
Dim uidoc As notesUIDocument
Dim doc As notesDocument
Dim newDoc As notesDocument
Dim targetBody As notesRichTextItem
Dim sourceBody As notesRichTextItem
Set myDb = s.currentDatabase
Set uidoc = ws.currentDocument
Set doc = uidoc.Document
Set sourceBody =doc.GetFirstItem
("Body")
Set newDoc = New notesDocument
(myDb)
newDoc.Form = "myForm"
newDoc.Field1 = Doc.Field1(0)
Set targetBody = New NotesRichTextItem
(newDoc, "Body")
Call targetBody.AppendText
("This is a new document:")
Call targetBody.AddNewLine(2)
Call targetBody.AppendRTItem
(sourceBody)
' to clear memory in Domino
Delete targetBody
'********************************
Call ws.EditDocument(True, newDoc)
|