Copy an attachment to new document

I am creating a new document in LotusScript from the Current open document by running an Agent. Everything is copied but the ATTACHMENT is not copying into a new document. How I can copy an attachment from an opened document to a new created document?

There are two good methods in LotusScript, either of which should do what you want to do, including copying the attachments:

CopyToDatabase and AppendAsRTItem

Set newNotesDocument = notesDocument.CopyToDatabase( notesDatabase )
This method will create a new document based on the current document. You can specify the current database as the "new" database location, and the current document as the original document. Your result will be a new document, in the current database, which should be identical (except for it's UNID and NoteID and modification date/times).

Call notesRichTextItem.AppendRTItem( notesRichTextItem2 )
This method will take a rich text item and append it to a rich text item in another document. You have to already have created the 'new' document and have a handle to the "new" Rich Text field. Here the notesRichTextItem2 is the "new" field.

Dig Deeper on Lotus Notes Domino Administration Tools

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...