Sub createMailFile( user As String, server As String, _
file As String )
Dim templateDb As NotesDatabase
Dim mailDb As NotesDatabase
Dim directory As New NotesDbDirectory( server )
Set templateDb = directory.GetFirstDatabase( TEMPLATE )
While Not ( templateDb.TemplateName = "StdR4Mail" )
Set templateDb = directory.GetNextDatabase
Wend
Call templateDb.Open( "", "" )
Set mailDb = templateDb.CreateFromTemplate _
( server, "mail\"+file, True )
mailDb.Title = user + " Mail"
Call mailDb.GrantAccess( "Administrators", _
ACLLEVEL_MANAGER )
Call mailDb.GrantAccess( user, ACLLEVEL_EDITOR )
If ( server <> "" ) Then
Call mailDb.GrantAccess( server, ACLLEVEL_MANAGER )
End If
End Sub
A sample call to this sub might look like this:
Call createMailFile( "Brandon Herkle", "Pyongyang", _
"brandon.nsf" )