Using LotusScript, how can you get the Notes name of a document's sender
Posted on 2004-09-08
I have been pouring through the Notes classes, trying to find a method with which I can get the Notes name of the sender so that I can script an automated reply.
What I have been asked to do is script an action button that managers in various locations can send out to their associates. The button will obtain some information from their systems and return it to the sender in an auto generated email. I have all the functinality working except that I had to hard code my email address in the code in order for it to work properly. If I could I would just out instructions for the managers on how to edit the button and replace my email address with theirs, but they don't have designer licenses so they cannot perform the edits.
I was thinking that there must be a way to grab the email address of the sender, store it in a variable and then call the doc.send to that variable.
The pertinent code is listed below, and I appreciate any and all help.
'set environment for the return document
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
'setup the return document
Set db = session.CurrentDatabase
Set rtdoc = New NotesDocument (db)
Set rtitem = New NotesRichTextItem (rtdoc, "body")
rtdoc.Subject = "Re: " & doc.Subject (0)
rtdoc.Body = sMessage$ & nl$ & sBuf$
'send doc back to admin
Call rtdoc.Send(False, "Jeffrey Petter/EMPL/NY/Verizon@VZNotes")