How can I create an agent that copies a particular field in an e-mail to the member section of a particular group in my address book? Obviously the field in the e-mail is always an e-mail address.
QUESTION POSED ON: 16 JUN 2005
QUESTION ANSWERED BY: Mathew Newman
Your agent simply needs to loop through the addresses in the current document, get a handle on the local address book and then take the names in the SendTo, CopyTo or BlindCopyTo items and copy the required entries into the "members" item of the address book entry. Just off the top of my head, you agent would look something like this:
Dim uiws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim localdir As New NotesDatabase("","names.nsf")
Dim vw As NotesView
Dim doc, groupdoc As NotesDocument
Dim one, two, three As String
Set uidoc = uiws.CurrentDocument
Set doc = uidoc.Document
Set vw = localdir.GetView("groups")
Set groupdoc = vw.GetDocumentByKey("yourgroupname")
'you will need to loop here
one = doc.sendto(0)
two = doc.copyto(0)
three = doc.bliendcopyto(0)
groupdoc.members = one &";" & two & ";" & Three
Call groupdoc.save (True, True, False)
Or something similar, but I trust this will point you in the right direction.
|
 |
|