Lotus Notes, hey?? Here is some sample code that you can try out. Not sure
of version specific problems:
=====Code Starts here=====
Sub MailData()
Dim Session As Object, DB As Object, Memo As Object
Dim Server$, Mailfile$
Dim Item As Object, strSubject As String, strBody As String
' These are my variables I use for my materials
strSubject = "Put Your Subject Here, or use variables"
Set Session = CreateObject("Notes.NotesSession")
' Read the current mail server from Notes.ini
Server$ = Session.GETENVIRONMENTSTRING("MailServer", True)
' Read the current mail file from Notes.ini
Mailfile$ = Session.GETENVIRONMENTSTRING("MailFile", True)
' Try to open the mail database
Set DB = Session.GETDATABASE(Server$, Mailfile$)
' If Mail db not accessible, return an error
If Not DB.IsOpen Then
MsgBox "Could not access Notes mail file! Please call Your Name at Your
Extension to receive credit."
Exit Sub
End If
'LN Message
'Create a memo in the user's mail file
Set Memo = DB.CREATEDOCUMENT
'Set the form to be a mail memo
Memo.Form = "Memo"
Memo.copyto = "wherever"
'Set the "from" field (not necessary)
Memo.From = Session.UserName
'Set the recipient of the memo (you will change this for your needs)!
Memo.SendTo = "
[email protected]"
'Give the memo a subject
Memo.Subject = strSubject
' Give the memo a body message
' These are some of the variables I use
Memo.Body = "I have reviewed the presentation. I scored " & Format(Score,
"00.0%") & _
" on the quiz." & Chr(10) & "First name: " & strfirstname & Chr(10) & _
"Last name: " & strlastname & Chr(10) & "SSN: " & strSSN & Chr(10) &
Chr(10) & _
"Items in this training that were most useful to me or aided my
learning: " & Chr(10) & strFeedback1 & Chr(10) & Chr(10) & _
"Items in this training that were least useful to me or interfered with
my learning: " & Chr(10) & strFeedback2 & Chr(10) & Chr(10) & _
"Recommendations to improve this training: " & Chr(10) & strFeedback3 &
Chr(10) & Chr(10) & _
"Did the training help improve existing skills or provide information to
enhance personal/professional growth? " & Chr(10) & strFeedback4 & Chr(10) &
Chr(10) & _
"Database Status:" & strDatabaseStatus
'Send the memo
Call Memo.SEND(False, False)
' Restore NOTES variables back to nothing
Set DB = Nothing
Set Session = Nothing
End Sub
=====Code Stops Here=====