Question: I'm stuck with this problem for days

I have to read a specific mailbox in lotus notes and bring all the content into an excel spread sheet

but so far I have only been able to read the default inbox and have no way of switching to the other mailbox. I 'm really new to VBA can any one help me sort this out

here is the code I 'm using

```
Set NSession = CreateObject("Notes.NotesSession")
   'get the name of the mailfile of the current user
DbLocation = NSession.GETENVIRONMENTSTRING("mail/mailbox", True)

'Get the notesdatabase for the mail.
Set NMailDb = NSession.GETDATABASE("mailboxer", DbLocation)
MsgBox (DbLocation)

```

I get an empty msgbox poping up

Answer: 
GetEnvironmentString() reads the notes.ini file. I'm not sure that's what you really want to be doing. Just from the syntax, I think you're using "mail/mailbox" as a placeholder for the actual path to the mailbox that you're looking for. E.g., you're really trying to read the mail from something like "mail/jsmith.nsf". (If I'm wrong, and you really do want to be reading the notes.ini file to get the location of the mail file, then your problem is that "mail/mailbox" is not a valid key for an ini file entry.)

My next assumption is that the Domino server where the mailbox lives is called "mailboxer", because that's what you're putting in the first argument of GetDatabase().

If I'm right about these things, then what what you need is 

```
Set NMailDb = NSession.GETDATABASE("mailboxer", "mail/mailbox") 

```

*where "mail/mailbox" is replaced with the actual path to the mailbox that you are trying to open.*
Some thoughts:

* use Lotus.NotesSession if you don't have to interact with the Notes UI (Lotus.NotesSession is COM based, whereas Notes.NotesSession is OLE based)
* make sure the user of the Notes client on the workstation running your VBA application has the rights require to open and read the mailbox