troubleshooting Question

Lotus Notes Button to make changes to Location Documents

Avatar of timkrampe1
timkrampe1 asked on
Lotus IBM
5 Comments1 Solution615 ViewsLast Modified:
I am trying to create a Button that i can email to users to make a few changes in the local address book.

I am using Domino 6.5.5 and Notes Client 7.0.1

The button needs to change 2 things in any location document. It needs to change the "Domino Directory Server" on the "Servers" tab and the "Mail Addressing" on the "Mail" tab.

The code below makes the changes but the changes do not seem to go into effect until you manually open the location doc for editing, edit any field and then save. Any ideas/suggestions?


'Modifies directory server and mail addressing fields
'Sets all of the location documents

Sub Click(Source As Button)
Dim session As New notessession
Dim workspace As New NotesUIWorkspace
Dim uiw As New notesuiworkspace
Dim uidoc As notesuidocument
Set uidoc = uiw.currentdocument
Dim doc As notesdocument
Set doc = uidoc.document

'For The Current User in The Current Session, Get All The NABs

Forall books In session.addressbooks

'Check If The Current NAB is Private or Public
'If The NAB Is Private, Than It Should Be Your Personal NAB

If books.isprivateaddressbook And books.filename = "names.nsf" Then

'Verify if The NAB is Open, If Not, Open it

If Not(Books.isopen) Then
Call Books.open("",books.filename)

'Now Get All The Documents in The Location View

Set view = books.getview("Locations")
Set doc = view.getfirstdocument
While Not (doc Is Nothing)

'Modify Mail Addressing

Call doc.replaceitemvalue ("directoryserver","MAIL01/SRV/PDCO")
Call doc.replaceitemvalue ("mailaddressing","Local and Server")
Call doc.save (True,True)
Set doc = view.getnextdocument(doc)
Wend
End If
End If
End Forall
Call uidoc.send
End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros