Expert Answer Center > Experts On Demand > View Answer
EMAIL THIS
Experts on Demand
  EXPERTS ON DEMAND HOME     POSE A QUESTION     VIEW ANSWERS     BROWSE BY TOPIC        RSS FEEDS  
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.
HomeExperts on DemandIT Expert Webcast SeriesExpert KnowledgebaseSite Index
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts