Domino Code Fragment

Code Name*
Sending an e-mail message to the author of the current document
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.117.216.229
Description*
Sends and E-mail to author of current document!
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Sub Click(Source As Button)
' NEW: access the document that's currently open on the workspace
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument


' UNCHANGED from previous script:
Dim db As NotesDatabase
Dim doc As NotesDocument
' get the database
Set db = New NotesDatabase( "", "learning.nsf" )
' create a new document in the current database
Set doc = New NotesDocument( db )
' set the new document's form so it'll be readable as a mail memo
doc.Form = "Memo"
' set the new document's Subject
doc.Subject = "Request"
' set the new document's Body
doc.Body = "Please send me more information about this."


' NEW: use the NotesUIDocument object to get
' the value of the From field, which holds the author's name
Call doc.Send( False, uidoc.FieldGetText( "From" ) )
End Sub