Set item_File = doc.GetFirstItem( "$File" )
If Not item_File Is Nothing Then Call item_File.CopyItemToDocument( docnou, "$File" )You have to copy the rich text field:I receive the error Object variable not set at line rtitemB.Type = RICHTEXT ) Then !
Example from Notes 5 Designer Help:
Dim docA As NotesDocument
Dim docB As NotesDocument
Dim rtitemA As Variant
Dim rtitemB As Variant
'...set values of docA and docB...
Set rtitemA = docA.GetFirstItem( "Body" )
Set rtitemB = docB.GetFirstItem( "Body" )
If ( rtitemA.Type = RICHTEXT And _
rtitemB.Type = RICHTEXT ) Then
Call rtitemA.AppendRTItem( rtitemB )
Call docB.Save( False, True )
End If
Andreas
Toma,it doesn't works because I have an ~~tmpid.ide file (an ID file backup) in the $File field of the mail document so when I copy this doc I can't see anything in the destionation doc (the Body field doesn't exist in the source document)
There is no need to copy the $File - items. Just copy the Body-Richtext-Item via
Set itemMyBody = doc.GetFirstItem( "Body" )
If Not itemMyBody Is Nothing Then Call itemBody.CopyItemToDocument( docnou, "BodyNew" )
The $File - items will be created automatically when you save the target document.