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
ASKER CERTIFIED SOLUTION
Bill-Hanson

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 5 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 5 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004