Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embed attachments using Lotus Script

Status
Not open for further replies.
Sep 2, 2002
32
DE
I wrote this script to open an attachment, but for some reason I can't get it to run, it complains set oe bit, that object variant net set, any ideas??

Dim uiw As New notesuiworkspace
Dim filesselected As Variant
filesselected = uiw.openfiledialog(False, "Select files to open.", "","C:\")

If (filesselected(0) = "") Then
Print "You selected no files to open."
End If

Dim session As New notessession
Dim db As notesdatabase
Dim doc As notesdocument
Dim rtf As notesrichtextitem
Dim oe As notesembeddedobject
Set db = session.currentdatabase
Set doc = db.createdocument
doc.form = "Invoice/Credit"
doc.title "Temp"
Set rtf = New notesrichtextitem (doc,"attach")
Set oe = rft.Embedobject(EMBED_ATTACHMENT,"",filesselected(0),"temp")
Call doc.save(True, False)
 
Simple problem, my friend.
You have defined RTF as a rich text field object, but you use RFT to embed the attachment (on the oe line).
Notes does not know what RFT is, so it complains.

It happens to everybody ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top