For the record
Procedure 1:
Private Sub InitLotusNotesSession()
bStatus = SetLoginUser(INIFilePath & "Spec.id"
If (bStatus = True) Then
bStatus = InitGUINotesSession()
If (bStatus = True) Then
bStatus = SetLoginUser(sCurrUserID
Else
Exit Sub
End If
Else
Exit Sub
End If
End Sub
Procedure 2:
Private Function SetLoginUser(ByVal myNewUserID As String
Dim sNotesIniFile As String
Dim objINI As New _IniFile
Dim INIFile As String = "Intfc.ini"
With objINI
.Path = INIFilePath & INIFile
.Section = "LOTUS_NOTES"
.myDefault = "NOT AVAILABLE"
.Key = "INI_FILE"
sNotesIniFile = .myValue
Debug.WriteLine(.Success)
End With
If (sNotesIniFile <> "NOT AVAILABLE") Then
With objINI
.Path = sNotesIniFile
.Section = "Notes"
.myDefault = "NOT AVAILABLE"
.Key = "KeyFilename"
myCurrentUserID = .myValue
If (sCurrUserID <> "NOT AVAILABLE") Then
.myValue = myNewUserID
Else
SetLoginUser = False
Exit Function
End If
End With
Else
SetLoginUser = False
Exit Function
End If
SetLoginUser = True
sNewUserID = myNewUserID
sCurrUserID = myCurrentUserID
End Function
Procedure 3:
Private Function InitGUINotesSession() As Boolean
Try
InitGUINotesSession = False
gobjSession = CreateObject("Lotus.NotesSession")
Call gobjSession.Initialize(myPassword)
gobjDB = gobjSession.GetDatabase(myServer
InitGUINotesSession = True
Exit Function
Catch ex As Exception
'MsgBox(ex.ToString & vbCrLf & vbCrLf & " Error in Initializing Notes Session!")
Logger.LogWithDate(LogFile
InitGUINotesSession = False
End Try
End Function
Brief Description:
1. SetLoginUser is the procedure that captures the current LN user
2. gobjSession is a Domino.NotesSession-type variable/object.
3. gobjDB is a Domino.NotesDatabase-type variable/object.
No comments:
Post a Comment