Ask the Expert

Attach through LotusScript without having to detach and reattach

How do I attach an attachment through LotusScript without having to detach and reattach on to another form? I got the object but I need to put it on another form, hopefully without detach and reattach.

The EmbedObject Method of the NotesRichtext class allows you to create attachments and other embedded objects. However, it doesn't let you move one from one document to another. We use code below to copy a file from an e-mail to a new document. I would also add a shell commend to delete the detached file once created.

Set rtiFile = doc.GetFirstItem("$File") Set embobjReport = doc.GetAttachment(rtiFile.Values(0)) strFilePath = Environ("temp") & "" strFileName = doc.Subject(0) & " " & "." & Right(embobjReport.Name, 3) Call embobjReport.ExtractFile(strFilePath & strFileName) Call rtiBody.EmbedObject(EMBED_ATTACHMENT, "", strFilePath & strFileName, strFileName)

This was first published in May 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: