Hello dear all,
I have an small issue with the Lotus Notes Password.
Problem is: Open Lotus Notes and entering the Notes User Password using VBA
After the code line:
Set session = CreateObject("Notes.NotesSession")
Lotus Notes opens and asks me for my Lotus Notes Access Password
I need to enter this manually in the Lotus Notes Password Window and only then the code continues running.
There is somehow a code line which should input the password automacitcally:
session.Initialize ("UserIdPassword")
but I do not manage to get it working.
Does somebody have an idea of how to write this code line correctly?
Best wishes from Luxemburg
and thanks in advance for any tip you may have
Jerry
Please see below an similar code where it works, but with this code the email sending is not working
I have an small issue with the Lotus Notes Password.
Problem is: Open Lotus Notes and entering the Notes User Password using VBA
After the code line:
Set session = CreateObject("Notes.NotesSession")
Lotus Notes opens and asks me for my Lotus Notes Access Password
I need to enter this manually in the Lotus Notes Password Window and only then the code continues running.
There is somehow a code line which should input the password automacitcally:
session.Initialize ("UserIdPassword")
but I do not manage to get it working.
Does somebody have an idea of how to write this code line correctly?
Best wishes from Luxemburg
and thanks in advance for any tip you may have
Jerry
Code:
Public Sub SendMail()
Dim Subject As String
Dim Maildb As Object
Dim UserName As String
Dim MailDbName As String
Dim MailDoc As Object
Dim session As Object
Set session = CreateObject("Notes.NotesSession")
session.Initialize ("UserIDPassword") '<<<< Here I have the problem
'Run-time error '438'
'Object doesn 't support this property or method
UserName = session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = session.GetDatabase("", MailDbName)
If Maildb.IsOpen = True Then
Else
Maildb.OPENMAIL
End If
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
MailDoc.sendto = "myemail@home.com"
MailDoc.Subject = "Test Mail Sent"
MailDoc.Body = "Body Text"
MailDoc.SAVEMESSAGEONSEND = True
MailDoc.PostedDate = Now()
MailDoc.Send 0
Set Maildb = Nothing
Set MailDoc = Nothing
Set session = Nothing
End Sub
Please see below an similar code where it works, but with this code the email sending is not working

Code:
Sub Test()
Dim session As NotesSession
Set session = CreateObject("Lotus.NotesSession") 'When I replace "Lotus" with "Notes" then it does not work
session.Initialize ("UserIdPassword")
End Sub