How to Attach Documents With LotusScript


The LotusScript language provide users with the tools to select, update and modify Lotus Notes databases. You can use the LotusScript program to attach a file to a Notes document that you edit by adding embed objects to your Notes database. LotusScript supports a wide variety of data types that you can include in the Notes documents, such as texts, spreadsheets and database reports. By attaching a file to the Notes document, you can use data from different user sources in your Lotus Notes application.

  • Click "Start" in Windows and then click "LotusScript Editor."

  • Enter the following code in the open window to attach the "test.txt" document to the Notes database:

    Sub Initialize

    Dim ses As New NotesSession

    Dim db As NotesDatabase

    Dim collection As NotesDocumentCollection

    Dim doc As NotesDocument

    Dim rtitem As Variant

    Dim object As NotesEmbeddedObject

    Set db = ses.CurrentDatabase

    Set collection = db.AllDocuments

    Set doc = collection.GetFirstDocument

    Set rtitem = doc.GetFirstItem("Body")

    Call rtitem.EmbedObject(EMBED_ATTACHMENT, "", "test.txt")

    Call doc.Save(True, True)

    End Sub

  • Click "File" and then click "Save" to apply the change to the Notes database.

Related Searches


  • Photo Credit Chad Baker/Photodisc/Getty Images
Promoted By Zergnet


You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!