Changing users internet address in addressbook

Hi Everyone,

I want to change my company selected users internet address in address book.Like if user current address is abc@xyz.com then i want to update it like abc@in.xyz.com.I have a list of select users in excel format, so can i do it through export and import method or any other way through an agent.Any idea?

Kindly advise.

Hariom

Subject: Re: Changing users internet address in addressbook

Write a lotus script agent which reads cell value from excel file and update in person document in NAB.You need to workout the logic to locate the person document in NAB based upon email id in excel sheet.

Here is a snippet to read data from excel file.

Sub Initialize

Dim session As New NotesSession

Dim col As NotesDocumentCollection

Dim doc As NotesDocument

Dim db As NotesDatabase

Dim xlApp As Variant, xlsheet As Variant, xlwb As Variant, xlrange As Variant



Set db=session.CurrentDatabase

Set L100 = db.GetView("ListOf100s")

Set xlApp = CreateObject("Excel.Application")

xlApp.Visible = True 'Excel program is visible to see what is happening



Set xlwb=xlApp.Workbooks.Open("C:\completefilepath.xlsx")

Set xlsheet =xlwb.Worksheets(1) 

For i = 1 To 10 '(Last Row of excel sheet)

	xlEMailID = Trim(Cstr(xlsheet.Range("A"+Cstr(i)).Value)) ' or whichever cell contains email id.

	xlEMailID = "" 'Do string operation to get email ID without .in

	srchFormula = {Select Form="Person" & InternetAddress="}+xlEMailID +{"}

	Set col = db.Search(srchFormula , Nothing, 0)

	Set doc = col.GetFirstDocument

	While Not doc Is Nothing

’ Usually one document will be available in collection, but if its more than one, update all with new Internet address

		doc.InternetAddress = Trim(Cstr(xlsheet.Range("A"+Cstr(i)).Value))

		Call doc.Save (True, False)

		Set doc = col.getNextDocument(doc)

		

	Wend

Next

End Sub

HTH

Vinit