Add an attachment to Lotus Notes through VBA
Posted on 2000-05-12
I have succesfully created a link to Lotus Notes via Excel's VBA. I am then able to create an e-mail out of the Excel environment.
Here is what I have so far:
Dim SESSION As Object
Dim db As Object
Dim doc As Object
Dim ws As Object
'Examples of definitions
'this needs to be changed for YOU!
Server = "x"
Recipient = "x.nsf"
Set SESSION = CreateObject("Notes.NotesSession")
Set ws = CreateObject("Notes.NotesUIWorkspace")
Call ws.opendatabase(Server, Recipient)
Set db = SESSION.GetDatabase(Server, Recipient)
Set doc = db.CreateDocument()
send_to = Cells(1, 1)
subject_out = Cells(2, 1)
body_out = Cells(3, 1)
doc.sendto = send_to
doc.form = "Main Topic"
doc.Subject = subject_out
doc.body = body_out
Call doc.Save(True, False)
The above will take certain cells from the Excel spreadsheet and set them equal to the subject, mail to , etc...
How do I add an attachment to the e-mail as well?
Is it as simple as doc.something?