Page 1 sur 1

Document "About"

MessagePublié: 03 Jan 2008 à 11:23
par Michael DELIQUE
Code : Tout sélectionner
Function SetAboutDocument_API(db As NotesDatabase) As NotesDocument
   
%REM
'Variables API pour la fonction  SetAboutDocument_API
Declare Private Function NSFNoteUpdate Lib "nnotes.dll"  Alias "NSFNoteUpdate" (  Byval hNT As Long, Byval F As Integer) As Integer
Declare Private Function NSFNoteSetInfo Lib "nnotes.dll"Alias "NSFNoteSetInfo" (  Byval hNT As Long, Byval M As Integer, V As Any) As Integer
Declare Private Function NSFNoteCreate Lib "nnotes.dll"  Alias "NSFNoteCreate" (  Byval hDB As Long, hNT As Long) As Integer
Declare Private Function OSPathNetConstruct Lib "nnotes.dll" Alias "OSPathNetConstruct" (  Byval NullPort As Long, Byval Server As String, Byval FIle As String, Byval PathNet As String) As Integer
Declare Private Function NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" ( Byval dbName As String, hdb As Long ) As Integer
Declare Private Function NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" ( Byval hdb As Long ) As Integer
%END REM
   
   'Déclaration Variables
   
   Dim nbHDB As Long
   Dim nbHNT As Long
   Dim Space1024 As String
   
   On Error Goto ErreurHandle
   
   Set SetAboutDocument_API = Nothing
   
   If db Is Nothing Then
      Exit Function
   End If
   
   Set SetAboutDocument_API = db.GetDocumentByID("FFFF0002")
   
   If SetAboutDocument_API Is Nothing Then
               
         Space1024 = Space(1024)
         
         OSPathNetConstruct 0, db.Server, db.FilePath, Space1024
         NSFDbOpen Space1024, nbHDB
         NSFNoteCreate nbHDB, nbHNT
         NSFNoteSetInfo nbHNT, 3, "&H8002"
         NSFNoteUpdate nbHNT, 0
         NSFDbClose nbHDB
         
         Set SetAboutDocument_API = db.GetDocumentByID("FFFF0002")
      
   End If
   Exit Function
ErreurHandle:
   Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   Set SetAboutDocument_API = Nothing
   Exit Function
End Function