Coping Attachment to Body

I have a document that has an attachment.In my querysave event, I am creating a memo that will contain the document and attachment.

However, I get the error:

Can’t copy items of type ATTACHMENT or OTHEROBJECT

Any ideas - using LS - how I can get the current document and attachment(s) mailed?

Code is below:

Sub Querysave(Source As Notesuidocument, Continue As Variant)

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim rt As NotesRichTextItem

Dim attachment As NotesItem

Set db = session.CurrentDatabase

Set uidoc = workspace.CurrentDocument

Set doc = uidoc.Document

Set maildoc = New NotesDocument(db)

Set rt = New NotesRichTextItem(maildoc, “Body”)

Set attachment = doc.GetFirstItem( “$File” )

maildoc.Form = “Memo”

maildoc.DisplaySent = “Notes Messenger”

maildoc.Subject = “Test”

maildoc.sendto=doc.GetItemValue(“forwarded_to”)

Call attachment.CopyItemToDocument(maildoc, “Body” )

Call maildoc.send(True)

End Sub

Thanks,

Tony

Subject: Coping Attachment to Body

try this tip

https://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/c286763375745e5b852572430051c367?OpenDocument