I am experienced in VB6 (Visual Basic) and VBA (Visual Basic for Applications) programming. I'd like to use LotusScript to create private agents in my Lotus Notes client 6.5 to automate email file attachment and detachment processes. How can I do this?
Nothing could be easier. But first, you must be aware that the object model doesn't match the user interface (UI):
' where doc is NotesDocument the document you are attaching a document to Dim object As NotesEmbeddedObject Dim body as NotesRichTextItem Set body = doc.GetFirstItem("body") ' Assume body field is garanteed to exist and be rich text. ' OR, IF CREATING A NEW DOC: Set rtitem = New NotesRichTextItem( doc, "Body" ) Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", yourFileName)
Do you have comments on this Ask the Expert Q&A? Let us know.
Related information from SearchDomino.com:
- Expert Advice: Retrieve ID file as attachment in new mail using LotusScript
- Learning Guide: LotusScript
- Tutorial : 30 LotusScript tips
- Reference Center: LotusScript resources and advice
Dig Deeper on LotusScript
Related Q&A from Cregg Hardwick
A user wants to know if it's possible for LotusScript to read an attachment in a Notes document without first detaching it. Find out our expert's ... Continue Reading
Learn about different options using LotusScript code and Formula language to customize the principal field of outgoing Lotus Notes email messages. Continue Reading
Read about merging cells in a Microsoft Word table using LotusScript and an Excel example, along with the thought process that goes along with it. Continue Reading