DumpItem
[syntax="ls"]Const APIModule = "NNOTES" ' Windows
Declare Function OSPathNetConstruct Lib APIModule Alias "OSPathNetConstruct" _
( Byval NullPort As Long, Byval Server As String, Byval FIle As String, Byval PathNet As String) As Integer
Declare Function NSFDbOpen Lib APIModule Alias "NSFDbOpen" _
( Byval PathName As String, DbHandle As Long) As Integer
Declare Function NSFDbClose Lib APIModule Alias "NSFDbClose" _
( Byval DbHandle As Long) As Integer
Declare Function NSFNoteOpen Lib APIModule Alias "NSFNoteOpen" _
( Byval DbHandle As Long, Byval NoteID As Long, Byval F As Integer, hNT As Long) As Integer
Declare Function NSFNoteClose Lib APIModule Alias "NSFNoteClose" _
( Byval hNT As Long) As Integer
Declare Function MailGetMessageBodyComposite Lib APIModule Alias "MailGetMessageBodyComposite" _
( Byval hNT As Long, Byval N As String, Byval D As String, nD As Long) As Integer
Declare Sub NEMDisplayError Lib "NNOTESWS" Alias "NEMDisplayError" _
( Byval E As Long)
Sub DumpItem(db As NotesDatabase, noteID As String, item As String, file As String)
p$ = String$(1024, " ")
OSPathNetConstruct 0, db.Server, db.FilePath, p$
Dim hDB As Long
NSFDbOpen p$, hDB
If hDB = 0 Then Exit Sub
Dim hNT As Long
NSFNoteOpen hDB, Clng("&H" & noteID), 0, hNT
If Not hNT = 0 Then
s% = MailGetMessageBodyComposite(hNT, item, file, nD&)
If Not s% = 0 Then NEMDisplayError s%
NSFNoteClose hNT
End If
NSFDbClose hDB
End Sub[/syntax]
Declare Function OSPathNetConstruct Lib APIModule Alias "OSPathNetConstruct" _
( Byval NullPort As Long, Byval Server As String, Byval FIle As String, Byval PathNet As String) As Integer
Declare Function NSFDbOpen Lib APIModule Alias "NSFDbOpen" _
( Byval PathName As String, DbHandle As Long) As Integer
Declare Function NSFDbClose Lib APIModule Alias "NSFDbClose" _
( Byval DbHandle As Long) As Integer
Declare Function NSFNoteOpen Lib APIModule Alias "NSFNoteOpen" _
( Byval DbHandle As Long, Byval NoteID As Long, Byval F As Integer, hNT As Long) As Integer
Declare Function NSFNoteClose Lib APIModule Alias "NSFNoteClose" _
( Byval hNT As Long) As Integer
Declare Function MailGetMessageBodyComposite Lib APIModule Alias "MailGetMessageBodyComposite" _
( Byval hNT As Long, Byval N As String, Byval D As String, nD As Long) As Integer
Declare Sub NEMDisplayError Lib "NNOTESWS" Alias "NEMDisplayError" _
( Byval E As Long)
Sub DumpItem(db As NotesDatabase, noteID As String, item As String, file As String)
p$ = String$(1024, " ")
OSPathNetConstruct 0, db.Server, db.FilePath, p$
Dim hDB As Long
NSFDbOpen p$, hDB
If hDB = 0 Then Exit Sub
Dim hNT As Long
NSFNoteOpen hDB, Clng("&H" & noteID), 0, hNT
If Not hNT = 0 Then
s% = MailGetMessageBodyComposite(hNT, item, file, nD&)
If Not s% = 0 Then NEMDisplayError s%
NSFNoteClose hNT
End If
NSFDbClose hDB
End Sub[/syntax]