Improve company productivity with a Business Account.Sign Up
Be seen. Boost your question’s priority for more expert views and faster solutions
Sub SetLocationItem( itemname As String, itemvalue As Variant )
'This procedure sets an item "itemname" to value itemvalue in the current user's location doc
Dim PrivateAddressBook As notesdatabase
Dim CurrentLocation As notesdocument
Dim LocationString As String, strTemp As String, LocationID As String
'Set PrivateAddressBook = New Notesdatabase( "", "names.nsf" )
Set PrivateAddressBook = GetLocalNAB()
If PrivateAddressBook Is Nothing Then
Print "Cannot get your local address book."
LocationString = Session.GetEnvironmentString( "Location", True )
If LocationString <> "" Then
strTemp = Mid( LocationString, ( Instr( 1, LocationString, "," ) + 1 ) )
LocationID = Left( strTemp, ( Instr( 1, strTemp, "," ) -1 ) )
Set CurrentLocation = PrivateAddressBook.GetDocumentByID( LocationID )
If Not CurrentLocation Is Nothing Then
Call CurrentLocation.ReplaceItemValue( itemname, itemvalue )
Call CurrentLocation.Save( True, False )
Msgbox |Unable to get current location document. Check notes.ini setting "Location".|
Msgbox "Unable to get the location settings. Location setting in your notes.ini is empty."
Function GetLocalNAB() As NotesDatabase
Dim sAddressBook As String
Dim nCommaLocation As Integer
On Error Resume Next
sAddressBook = session.GetEnvironmentString( "NAMES", True )
nCommaLocation = Instr( sAddressBook, "," )
If nCommaLocation > 0 Then sAddressBook = Left( sAddressBook, nCommaLocation - 1 )
Set GetLocalNAB = New NotesDatabase( "", sAddressBook )
Open in new window
Dim valueArray(1) As String
valueArray(0) = "jnpbackup2.janpakint.com"
valueArray(1) = "jnpbackup2.janpak.com"
Call SetLocationItem( "$SavedAddresses", valueArray )
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.