CreateReplicaIDItem

CreateReplicaIDItem

Messagepar Stephane Maillard » 01 Août 2005 à 12:58

[syntax="ls"]Const wAPIModule = "NNOTES" ' Windows/32

Declare Private Function NSFDbOpen Lib wAPIModule Alias "NSFDbOpen" _
( Byval P As String, hDB As Long) As Integer
Declare Private Function NSFDbClose Lib wAPIModule Alias "NSFDbClose" _
( Byval hDB As Long) As Integer
Declare Private Function NSFNoteOpen Lib wAPIModule Alias "NSFNoteOpen" _
( Byval hDB As Long, Byval NoteID As Long, Byval F As Integer, hNT As Long) As Integer
Declare Private Function NSFNoteClose Lib wAPIModule Alias "NSFNoteClose" _
( Byval hNT As Long) As Integer
Declare Private Function NSFNoteUpdate Lib wAPIModule Alias "NSFNoteUpdate" _
( Byval hNT As Long, Byval F As Integer) As Integer
Declare Private Function NSFItemSetTime Lib wAPIModule Alias "NSFItemSetTime" _
( Byval hNT As Long, Byval N As String, T As Long) As Integer
Declare Private Function OSPathNetConstruct Lib wAPIModule Alias "OSPathNetConstruct" _
( Byval zP As Long, Byval S As String, Byval F As String, Byval N As String) As Integer


Sub CreateReplicaIDItem(doc As NotesDocument, itemname As String, rid As String)
db$ = Space(1024)
With doc.ParentDatabase
OSPathNetConstruct 0, .Server, .FilePath, db$
End With

Dim T(1) As Long ' TIMEDATE
T(0) = Clng("&H" & Mid$(rid, 9))
T(1) = Clng("&H" & Left$(rid, 8))

Dim hDB As Long
NSFDbOpen db$, hDB
If hDB = 0 Then Exit Sub

Dim hNT As Long
NSFNoteOpen hDB, Clng("&H" & doc.NoteID), 0, hNT
If Not hNT = 0 Then
NSFItemSetTime hNT, itemname & Chr$(0), T(0)
NSFNoteUpdate hNT, 0
NSFNoteClose hNT
End If

NSFDbClose hDB
End Sub[/syntax]
Cordialement

Stéphane Maillard
Avatar de l’utilisateur
Stephane Maillard
Lord of DominoArea
Lord of DominoArea
 
Message(s) : 8695
Inscrit(e) le : 16 Déc 2004 à 01:10
Localisation : Bretagne

Retour vers API