Link to home
Start Free TrialLog in
Avatar of codequest
codequest

asked on

Controlling LN email with VBA

I've got an MS Access DB that sends and tracks LN emails.   Right now it works only by sending emails from my account, i.e., the one associated with my LN client login on my machine.

I would like to do these functions using a group mail box for which I have admin rights.

So the question is how to redirect (and or control the) access to another Lotus Notes inbox via VBA...

Testing the process of checking the inbox, and even with a hard coded .NSF file and server, it still points to default inbox.
=====================================================================================================
This is the current code which looks at the users inbox: Need the ability to point to a different inbox

Set mSession = CreateObject("Notes.NotesSession")
UserName = mSession.UserName
MailDbName = Left$(UserName, 1) & Right(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = mSession.GETDATABASE("", MailDbName)

Maildb.OPENMAIL
Set NotesDocs = Maildb.GETVIEW("($Inbox)")
Set MailDoc = NotesDocs.GETLASTDOCUMENT

Any help with this would be appreciated.

Thanks!
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Instead of
UserName = mSession.UserName
MailDbName = Left$(UserName, 1) & Right(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"

Open in new window

use a fixed name like
MailDbName= "thegroupmaildb.nsf"

Open in new window

Avatar of jwtchdev
jwtchdev

Tried this solution with the same results. Resolved w/approach: Instead of separate db-Created a sub folder, and added a rule to post incoming emails to new folder, then parsed folder
Avatar of codequest

ASKER

sjef_bosman:  thanks for input

jwtchdev and I discussed this offline; I accept his solution.
Not really "correct", now is it? Next time you take a discussion off-line, be open about it. Anyway, it's against EE-rules (!) but in some cases it can't be avoided.

At least you owe us the outcome of the discussion, can you present it here?
ASKER CERTIFIED SOLUTION
Avatar of codequest
codequest

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't really understand, but if it works for you, no problem.

There seems to be a misunderstanding, maybe even mine: you talked about "using a group mail box", from that I understood that you share one database with multiple people, and that database has a fixed name, which is why I suggested not to use the user's name to fetch the mail database name but to use a fixed name. As I said, there's no problem when it works for you :-)