Solved

Attach a file from lotus script ?

Posted on 1998-10-28
1
2,241 Views
Last Modified: 2013-12-18
Hi,

I'am looking for a sample of lotus script to attach a file (excel for instance) into a rich text field. This without use any prompt windows.

Thanks
0
Comment
Question by:didede
1 Comment
 
LVL 1

Accepted Solution

by:
wrichard earned 50 total points
ID: 1117595
This script creates a new document in the current database, creates a new rich text item called Body on the document, and attaches the file profile.xls to the Body. It then sets the value of the Form and Subject items on the document and saves it.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc, "Body" )
Set object = rtitem.EmbedObject _
( EMBED_ATTACHMENT, "", "c:\profile.xls", "Profile" )
doc.Form = "Main Topic"
doc.Subject = "Here's Jim's document, as an attachment"
Call doc.Save( True, True )

A couple more example can be found  in the script section of the help database.  Look at the Notes RichTextItem class.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question