falls mal jemand eine Schablone per Knopfdruck wechseln möchte...
Declare Sub W32_OSPathNetConstruct Lib "nnotes.dll" Alias "OSPathNetConstruct" (Byval portName As String, Byval ServerName As String, Byval FileName As String, Byval retPathName As String)
Declare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval szDBName As String, dwDBHandle As Long) As Integer
Declare Function W32_NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" ( Byval dwDBHandle As Long) As Integer
Declare Function W32_DesignReplace Lib "nnotes.dll" Alias "DesignReplace" (Byval ht As Long, Byval hDB As Long, Byval dw1 As Long, Byval dw2 As Long, Byval dw3 As Long, Byval dw4 As Long) As Integer
Function ReplaceDesign(TemplDB As NotesDatabase, TargetDB As NotesDatabase) As Integer
on error goto errHandle
Dim PathName As String * 256
Dim TargetPathName As String * 256
Dim htemplate As Long
Dim htarget As Long
Dim DBDocPropTempl As NotesDocument
Dim DBDocPropTarget As NotesDocument
ReplaceDesign = false
Call W32_OSPathNetConstruct("", TemplDB.Server, TemplDB.FilePath, PathName)
Call W32_OSPathNetConstruct("",TargetDB.Server, TargetDB.FilePath,TargetPathName)
Call W32_NSFDbOpen(PathName, htemplate)
If htemplate=0 Then Exit Function
Call W32_NSFDbOpen(TargetPathName, htarget)
If htarget=0 Then Exit Function
Call W32_DesignReplace(htemplate, htarget, 1, 1, 0, 0)
Call W32_NSFDbClose(htemplate)
Call W32_NSFDbClose(htarget)
Set DBDocPropTempl = TemplDB.GetDocumentByID("FFFF0010")
Set DBDocPropTarget = TargetDB.GetDocumentByID("FFFF0010")
Call DBDocPropTempl.CopyAllItems(DBDocPropTarget)
Call DBDocPropTarget.Save(True, False)
ReplaceDesign = true
exit function
errHandle:
msgbox cstr(err) + " : " + error + " in Line " + cstr(erl)
exit function
End Function