Emailing to Specific Person

N

Neil Greenough

I asked this question a week or so ago, but received no reply so thought I'd
try again :)

Basically, I have the following code. This code is located behind a button
on a form and is used to send an email through Lotus Notes. Now, I'd ideally
like to alter this code, so that, when the button is clicked, the email
address is taken from the field "EmailAddress" on the form (the relevant
table) for the actual contact record being shown, and the new email is then
automatically addressed to that person.

I am looking for any kind individual who can alter the below code so as it
performs the above role.

Many thanks
__________

Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.getdatabase("", "")
Call notesdb.openmail
Rem make new mail message
Set notesdoc = notesdb.createdocument
Call notesdoc.replaceitemvalue("Sendto", strSupportEMail)
Call notesdoc.replaceitemvalue("Subject", "Problem Report")
Set notesrtf = notesdoc.createrichtextitem("body")
Call notesrtf.appendtext("Problem Report")
Call notesrtf.addnewline(2)
Rem attach Error Report doc
's = ActiveDocument.Path + "\" + ActiveDocument.Name
Call notesrtf.embedObject(1454, "", strCurrentPath, "Mail.rtf")
Rem send message
Call notesdoc.Send(False)
Set notessession = Nothing
 
P

Pringle9984

A little confusing (probably just because I'm sleepy) - I assume tha
strSupportEMail is the e-mail address you're sending to

If this is the case then all you should need to do is add in a line

strSupportEMail = [Me].[EmailAddress

(I'm assuming that the button is on same form as the e-mail addres
and that the name of the text box is EmailAddress, if not you'll hav
to specify exactly where it's getting it fro
[Forms].[FormName].[TextBox] or something like that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top