Learn when you want, where you want with convenient online training courses. Sign up now!
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
This course will introduce you to C++ 11 and teach you about syntax fundamentals.
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
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
Dim valueArray(1) As String
valueArray(0) = "jnpbackup2.janpakint.com"
valueArray(1) = "jnpbackup2.janpak.com"
Call SetLocationItem( "$SavedAddresses", valueArray )
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.