70 pts.
 Note item not found
Hi all, I have scenario where I need prepend some rich text to existing richtext  item . The Rich text Item already have rich text including the attachements. I also  dont want to tamper the formatting of contents in that rich text item . So to achieve that we are contents in temporary Rich text Item  item1, and then  reset the contents in original rt item , then append temporary Rich text Item contents to original. Following is the code used With Me.Body  Dim docTemp As New NotesDocument(CurrentDatabase )             'store the content of Body in a rt field because of some trouble we had with the bodies containing attachments  Set itemRTTemp = Me.Body.CopyItemToDocument( docTemp,"TempRT" )             Call Me.Document.ReplaceItemValue( .Name, "" ) ' prepend new rich text contents     Call Me.Body.AppendRTItem( itemRTTemp ) The code is working fine for 90% of documents on which this code is running. But for certain documents with attachments (huge or without icons or file extensions), the following error occurs. Note item not found TempRT . When debugged the exception occurring at line number 3. above marked in bold ie when  CopyItemToDocument is called. Provided the above scenario can any body help me out to give best possible solution , which holds good for many different notes clients? Note : I also dont want to detach and re attache attachments . If there is no other way other than detach and attach attachments to rich text item then i will have relook over provide this work around. thanks santosh

Software/Hardware used:
lotus notes ,lotus domino
ASKED: October 7, 2009  9:46 AM
UPDATED: October 7, 2009  3:57 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Did you look at the BeginInsert method of the NotesRichTextItem class? Check the example code; it might do what you want.

 2,700 pts.