Can anyone shed some light on how I can add an additional entry into everyone’s ‘User name:’ field of their Person Document using lotusscripting? I already have a script to register all of the users using the RegisterNewUser method.
Thanks.
Can anyone shed some light on how I can add an additional entry into everyone’s ‘User name:’ field of their Person Document using lotusscripting? I already have a script to register all of the users using the RegisterNewUser method.
Thanks.
Subject: Update Multiple Person Documents w/Lotusscript
Darren
You need to create a LS Agent, i would say do this in a empty NSF rather than create it in the NAB… The script would go something like this, assuming that you want to do this to every user
Create the NSF on the server that PAB resides on
Create an agent in the blank file
The Agent Trigger should be “ON EVENT”
The Agent Event should be “Action Menu Selection”
The Target should be “NONE”
The agent code will look something like this
Sub Initialize
Dim ThisSession As New NotesSession
Dim ThisDB As NotesDatabase
Dim NabDB As NotesDatabase
Dim NabView As NotesView
Dim NabDoc As NotesDocument
Dim NabItem As NotesItem
Set ThisDB = ThisSession.CurrentDatabase
Set NabDB = ThisSession.GetDatabase(ThisDB.Server, "Names.nsf")
Set NabView = NabDB.getView("People")
Set NabDoc = NabView.GetFirstDocument
Do While Not (NabDoc Is Nothing)
Set NabItem = NabDoc.GetFirstItem("FullName")
Call NabItem.appendToTextList( ... whatever it is you want to add ..)
Call NabDoc.Save(True,False)
Set NabDoc = NabView.GetNextDocument(NabDoc)
Loop
Messagebox("Done")
End Sub
Save your agent
Run The agent
**** WARNING ****
Since this is your NAB … TAKE A BACKUP UP FIRST!!! alternately make a NEW COPY of your name and work on that until you are happy with it!
Steve