Dim db As New NotesDatabase( "", "discuss4.ntf" )
Dim template As String
template = db.TemplateName
Messagebox( template )
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
このサブルーチンを呼び出す例は次のようになります。
Call createMailFile( "Brandon Herkle", "Pyongyang", _
"brandon.nsf" )