I am working on a Java program to send emails with attachments through the lotus notes client. A coworker gave me a vba script capable of this task to orientate myself. The script is following:
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.GetDatabase("", MailDbName)
Like magic this successfully opens the local notes database file and I am able to send emails. Now I tried to replicate this in Java with the Lotus Notes API "Notes.jar":
Session s = NotesFactory.createSession();
Database database = s.getDatabase("", "PATH TO NSF FILE");
If I give the getDatabase method the exact path to the nsf file it works like a charm but giving it the same value as MailDbName from the vba script it doesn't work. My question is how does this work in vba but not in Java? Giving the getDatabase method the exact path doesn't work on any other device except my own one. So how do I get this working on any device?
Many thanks!