AddDatabase method

I have a training application on all of our mail servers. I’d like to send a user a button that would add the app to their workspace based on the home server field in their PAB.

The code below works if I specify the name of home server. Is there a way to code this so that it would automatically find the user’s home server, then add the application?

Thanks in advance!

Sub Initialize

Dim ws As New NotesUIWorkspace

ws.AddDatabase "servername", "filename.nsf"

End Sub

Subject: AddDatabase method

u can use the session getenvironmentstring method and get the MailServer field from the local notes.ini

OR

U can look up the user in the Names.nsf and find it from there.

Subject: RE: AddDatabase method

Hi Yazdi

That worked! Thank you. Thought I’d share the code with the forum.

Sub Initialize

Dim ws As New NotesUIWorkspace

Dim session As New NotesSession

Dim server As String

server = session.GetEnvironmentString("MailServer", True )

ws.AddDatabase server, "filename.nsf"

End Sub