Opening lotus notes and inserting the emailaddress

soundsfishy

Registered User.
Local time
Today, 17:46
Joined
Sep 25, 2002
Messages
174
I found the following code but Im not sure how get access to insert a email address.

On my form I have a field called Email. I want user to be able double click the field which then opens Notes and inserts the email address for the current client record.


Any suggestions anyone.?


Private Sub Text790_DblClick(Cancel As Integer)
Dim strAddressee As String
Dim strSubject As String
Dim strBody As String
Dim objNotesWS As Object
Dim notesdb As Object

Call Shell("C:\notes\notes.exe", vbNormalFocus)

Set objNotesWS = CreateObject("Notes.NotesUIWorkspace")

Set notesdb = objNotesWS.COMPOSEDOCUMENT(, , "memo")

strAddressee = " "
strSubject = " "
strBody = ""

'notesdb.FIELDSETTEXT "EnterSendTo", strAddressee
notesdb.FIELDSETTEXT "SendTo", strAddressee
notesdb.FIELDSETTEXT "Subject", strSubject
notesdb.FIELDSETTEXT "Body", strBody

'notesdb.Send
'notesdb.Close

Set notesdb = Nothing
Set objNotesWS = Nothing
 
make your code a public procedure like

Code:
Public Sub SendMail(strAddressee As String, strSubject As String, strBody As String)

Dim objNotesWS As Object
Dim notesdb As Object

Set objNotesWS = CreateObject("Notes.NotesUIWorkspace")

Set notesdb = objNotesWS.COMPOSEDOCUMENT(, , "memo")

notesdb.FIELDSETTEXT "EnterSendTo", strAddressee
notesdb.FIELDSETTEXT "Subject", strSubject
notesdb.FIELDSETTEXT "Body", strBody

notesdb.Send
notesdb.close

Set notesdb = Nothing
Set objNotesWS = Nothing


then in the double click event, call this code by the following


SendMail Me!, "Subject", "Body"
 
You can use the FollowHyperlink method and the MailTo command if you only want to open a new email and address it with the current records email address. Check out my attached sample.
 

Attachments

Thanks guys!

Both suggestions worked nicely!! ...yippy!!

Youver made some people very happy here...Thank you Thank you
 

Users who are viewing this thread

Back
Top Bottom