Note item not found
70 pts.
0
Q:
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: Oct 7 2009  9:46 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
70 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Last Answered: Oct 7 2009  9:46 AM GMT by Santooudnur   70 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Stiletto   1155 pts.  |   Oct 7 2009  3:57PM GMT

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

 
0