Agent - change domain name in PAB

Hello,

I have a question from a person who wants to change all emailaddresses from name@aaa.com to name@bbb.com.

This is my code (found some things via google)

Sub Initialize

Dim ui As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Set uidoc = ui.CurrentDocument

Set doc = uidoc.Document



Dim 	old_domain As String

Dim  new_domain As String



old_domain = Inputbox$("What is the old domainname (to be replaced) ","Old domainname")

new_domain = Inputbox$("What is the new domainname ","New domainname")



doc.MailAddress =  Evaluate(|@ReplaceSubstring(MailAddress; old_domain; new_domain)| ,doc) 

doc.Email_1 =  Evaluate(|@ReplaceSubstring(Email_1; old_domain; new_domain)|, doc) 

doc.SameTimeLogin =  Evaluate(|@ReplaceSubstring(SameTimeLogin; old_domain; new_domain)|, doc ) 

End Sub

But nothing changes.

Any idea what’s missing, or what I’m doing wrong?

Thanks in advance

Greetings

Lainkes

Subject: Need to save

Looks like you need to save the document with a doc.save(true, false)

Subject: agent - change domain name in PAB

No, it doesn’t work.But I think the whole script is bad.

What I want is the following :

1.) Ask for server

2.) Ask for location of database

3.) Ask old domainname

4.) Ask new domainname

5.) Loop all addresses in PAB, and change the domainnames.

Does anyone has a script for this?

Many thanks in advance

Greetings

Lainkes