I have a vb.net app that calls Notes in the background (the client never opens) and executes the following:
After running those scripts a window pops up saying Lotus Notes has experienced an error and is logging it. Afterward I check the log and here is the error:
I don't have a clue where to go with this and am completely lost. Anyone with any suggestion of where to look, what to try, I would be so grateful! If you need more information, let me know as well. I wasn't even sure where to start with that.
Thanks,
Eva
Code:
Public Function ReadMail(ByVal MessageUniversalID As String, ByVal MailFolder As String) As String()
Dim EmailData(4) As String 'string data to return
Dim oNotesSession As New NotesSession
Dim oNotesDatabase As NotesDatabase
Dim oNotesDocument As NotesDocument
Dim sPassword As String = NotesPW 'Password used by COM to pass to the Notes client login.
Try
'create a notes session object
oNotesSession.Initialize(sPassword) 'Initialise session by passing a password. Lotus Notes will not load.
'Create a database handle to the database you wish to send the mail message from.
oNotesDatabase = oNotesSession.GetDatabase(NotesDB, NotesInbox, False)
'If the database is not already open then open it.
If Not oNotesDatabase.IsOpen Then
oNotesDatabase.Open()
End If
'retreive specific document
oNotesDocument = oNotesDatabase.GetDocumentByUNID(MessageUniversalID)
With oNotesDocument
EmailData(0) = .UniversalID.ToString
EmailData(1) = .GetItemValue("From")(0)
EmailData(2) = .GetItemValue("Subject")(0)
EmailData(3) = .GetItemValue("Body")(0)
EmailData(4) = .GetItemValue("DeliveredDate")(0)
End With
Catch ex As Exception
Console.WriteLine("{0} My Exception caught.", ex)
Finally
oNotesSession = Nothing
oNotesDatabase = Nothing
oNotesDocument = Nothing
End Try
Return EmailData
End Function
Public Sub MoveMail(ByVal MessageUniversalID As String, ByVal SourceFolder As String, ByVal DestinationFolder As String)
Dim oNotesSession As New NotesSession
Dim oNotesDatabase As NotesDatabase
Dim oNotesDocument As NotesDocument
Dim sPassword As String = NotesPW 'Password used by COM to pass to the Notes client login.
Try
'create a notes session object
oNotesSession.Initialize(sPassword) 'Initialise session by passing a password. Lotus Notes will not load.
'Create a database handle to the database you wish to send the mail message from.
oNotesDatabase = oNotesSession.GetDatabase(NotesDB, NotesInbox, False)
'If the database is not already open then open it.
If Not oNotesDatabase.IsOpen Then
oNotesDatabase.Open()
End If
'retreive specific document
oNotesDocument = oNotesDatabase.GetDocumentByUNID(MessageUniversalID)
With oNotesDocument
.PutInFolder(DestinationFolder)
.RemoveFromFolder(SourceFolder)
End With
Catch ex As Exception
Console.WriteLine("{0} My Exception caught.", ex)
Finally
oNotesSession = Nothing
oNotesDatabase = Nothing
oNotesDocument = Nothing
End Try
End Sub
Code:
06/03/2010 10:40:37 AM Lotus Notes client started
06/03/2010 10:40:40 AM Client Execution Security is enabled.
06/03/2010 10:41:06 AM Dynamic Client Configuration started
06/03/2010 10:41:06 AM Initializing Dynamic Client Configuration
06/03/2010 10:41:06 AM Dynamic Client Configuration updating policy information
06/03/2010 10:41:06 AM Dynamic Client Configuration: Returned an error adding policy information to the address book: Note item not found
06/03/2010 10:41:06 AM Dynamic Client Configuration: Applying policy bookmarks
06/03/2010 10:41:06 AM Dynamic Client Configuration updating location information
06/03/2010 10:41:06 AM Dynamic Client Configuration updating location information using policy
06/03/2010 10:41:06 AM Dynamic Client Configuration updating location information using policy
06/03/2010 10:41:06 AM Dynamic Client Configuration updating location information using policy
06/03/2010 10:41:06 AM Dynamic Client Configuration updating location information using policy
06/03/2010 10:41:06 AM Dynamic Client Configuration updating location information using policy
06/03/2010 10:41:06 AM Dynamic Client Configuration updating location information using policy
06/03/2010 10:41:06 AM Dynamic Client Configuration shutdown
Thanks,
Eva