Button Help Please

I am an administrator and we currently have no development resource. I am wondering if there is a kind developer who would assist me.

I need a button that will replace the ‘MailDomain’ field in the contacts in users personal address books. I need the button to work so that if MailDomain = xxxx then replace it with YYYYY. I would also like a pop to say x(number) entries sucessfully updated.

Any help would be greatly aprreciated.

Subject: Button Help Please

Hi,

Here is the code…

Sub Click(Source As Button)

Dim ws As New notesuiworkspace

Dim s As New notessession

Dim db As notesdatabase

Dim c As Variant

Dim view As notesview

Dim doc As notesdocument

Set db = s.currentdatabase

Set view = db.getview("Contacts")

Set doc = view.getfirstdocument



c = 0

While Not doc Is Nothing

	doc.maildomain = "Here give the new value you want"

	Call doc.save(1,0)

	c = c + 1

	Set doc = view.getnextdocument(doc)

Wend



Msgbox "Number of documents updated are   " & c

End Sub

Make sure you specify the value for Mail domain in the above code…

Subject: RE: Button Help Please

While Not doc Is NothingIf doc.MailDomain(0) = “old domain name here” Then

doc.maildomain = “Here give the new value you want”

Call doc.save(1,0)

c = c + 1

End if

Set doc = view.getnextdocument(doc)

Wend