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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attaching file Lotus Notes Access 97 edition

Status
Not open for further replies.

teabags

Instructor
Jul 11, 2006
2
GB
Hi I have a problem with wanting to make my code attach a file.

Here is my code to send an email with ms access 97.

I need help with adding code that will allow me to attach files to my message with a string address ie "strAttachmentAddress". Can somebody please help?

My code:
Function SendLotusEmail()
On Error GoTo Ett_Trap
Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Dim ToName As String
Dim CCName As String
Dim BCCName As String
Dim Subject As String
Dim BodyText As String
ToName = "teabags@tea.com"

CCName = ""

BCCName = ""
Subject = "This is a test"

BodyText = "You are tea"

Set notessession = CreateObject("Notes.Notessession")

Set notesdb = notessession.getdatabase("", "")
Call notesdb.openmail

Set notesdoc = notesdb.createdocument

Call notesdoc.replaceitemvalue("Sendto", ToName)

Call notesdoc.replaceitemvalue("CopyTo", CCName)

Call notesdoc.replaceitemvalue("BlindCopyTo", BCCName)

Call notesdoc.replaceitemvalue("Subject", Subject)

Call notesdoc.replaceitemvalue("Body", BodyText)

Call notesdoc.Send(False)

Call notesdoc.Save(True, False)

Set notessession = Nothing

MsgBox "Email sent"

Ett_Trap_Exit:
Exit Function

Ett_Trap:
MsgBox Err.Description
Resume Ett_Trap_Exit
End Function
 
this thread should be helpful: thread707-1076807

Cheers,

Roel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top