I often have to send out a button with some code to create a connection document in a local nab. Here is the code.
Messagebox "This action will automatically add Connection Documents to the <INSERT SERVER NAME> server if they do not already exist in your Personal Address Book.", 0 + 64, "New Connection Documents"
Dim db As New NotesDatabase("" , "names.nsf")
Dim view As NotesView
Dim doc As NotesDocument
Dim success As Variant
Dim connect As NotesDocument
Dim State As Integer
State = 0
Set view = db.GetView("Connections")
Set doc = view.GetFirstDocument
While Not (doc Is Nothing)
If doc.optionalnetworkaddress(0) = "<INSERT SERVER IP ADDRESS>" Then
Set doc = view.GetNextDocument(doc)
Set connect = db.CreateDocument
connect.form = "local"
connect.type = "Connection"
connect.destination = "<INSERT SERVER NAME>"
connect.lanportname = "TCPIP"
connect.connectiontype = "0"
connect.ConnectionRecordFirst = "Normal"
connect.optionalnetworkaddress = "<INSERT SERVER IP ADDRESS>"
success = connect.ComputeWithForm( False, False)
State = State + 1
Select Case State
Messagebox "Your Personal Address Book already has a Server Connection Document for <INSERT SERVER NAME>; no new connection documents have been created." , 0 + 64 , "Finished!"
Messagebox "Your Personal Address Book did not have a Server Connection document for <INSERT SERVER NAME>; a new connection document has been created." , 0 + 64, "Finished!"