Automatisch IDs erzeugen geht mit der NotesRegistration Class:
Sub Click(Source As Button)
Dim tmpDoc As NotesDocument
Set tmpDoc = thisDb.CreateDocument
If ws.DialogBox( "dlgRegistrierung", True, True, False, False, False, False, "Benutzerregistrierung", tmpDoc, True, False, True ) Then
Dim reg As NotesRegistration
Set reg = New NotesRegistration
Dim expirationDate As New NotesDateTime( "21.06.2100" )
'Voreinstellungen
reg.CertifierIDFile = tmpDoc.zulassungsstelle(0)
reg.CreateMailDb = True
reg.EnforceUniqueShortName = False
reg.Expiration = expirationDate.LSLocalTime
reg.GroupList = tmpDoc.gruppen
reg.IDType = ID_HIERARCHICAL
reg.IsNorthamerican = False
reg.IsRoamingUser = False
reg.MailCreateFTIndex = False
reg.MailInternetAddress = tmpDoc.email(0)
reg.MailOwnerAccess = 2
reg.MailSystem = 0
reg.MailTemplateName = tmpDoc.mailTemplate(0)
reg.MinPasswordLength = 6
reg.NoIDFile = False
reg.OrgUnit = tmpDoc.firma(0)
reg.RegistrationLog = "log.nsf"
reg.RegistrationServer = tmpDoc.registrierungsserver(0)
reg.ShortName = tmpDoc.vorname(0) + " " + tmpDoc.nachname(0)
reg.StoreIDInAddressBook = False
reg.StoreIDInMailfile = False
reg.SynchInternetPassword = False
reg.UpdateAddressBook = True
reg.UseCertificateAuthority = False
lastname = tmpDoc.nachname(0)
Dim fpraefix As String
fpraefix = Replace( tmpDoc.nachname(0) + tmpDoc.vorname(0), " ", "" )
fpraefix = Replace( fpraefix, ".", "" )
fpraefix = extUmlaute( fpraefix )
idFile = "c:\ids\people\" + fpraefix + ".id"
mailServer = tmpDoc.mailServer(0)
firstname = tmpDoc.vorname(0)
certPW = "xxxxxxxxxxxxx"
mailDbPath = "mail/" + fpraefix + ".nsf"
userpw = "xxxxxxxxxxx"
If reg.RegisterNewUser( _
lastname, _
idFile, _
mailServer, _
firstname, _
middleinitials, _
certPW, _
location, _
comment , _
maildbPath, _
fwdDomain, _
userpw, _
usertype, _
altName, _
altNameLang ) Then
Msgbox "Die Person wurde erfolgreich registriert!", 64, "Info"
End If
End If
End Sub