Hier noch der Vollständigkeit halber eine etwas kompaktere API Lösung. Da wir das NotesDocument ja schon haben, sparen wir uns das erneute Öffnen über die API
'Declaration
Type TIMEDATESTRUCTE
Innards(1) As Long
End Type
Declare Sub W32_NSFNoteGetInfo Lib "nnotes" Alias "NSFNoteGetInfo" (_
Byval note_handle As Long, _
Byval note_member As Integer, _
value_ptr As Any )
Declare Function W32_ConvertTIMEDATEToText Lib "nnotes.dll" Alias "ConvertTIMEDATEToText" (_
Byval nullFormat As Long, _
Byval textformat As Long, _
td As Any, _
Byval Buff As String, _
Byval maxlen As Integer, _
textLength As Integer) As Integer
Function NotesDocumentAddedToFile( ndoc As NotesDocument) As Variant
Dim hNote As Long
Dim tds As TIMEDATESTRUCTE
Dim sDateTime As String*256
Dim iDate As Integer
Dim vDateTime As Variant
hNote = ndoc.Handle
Call W32_NSFNoteGetInfo( hNote, 13, tds )
Call W32_ConvertTIMEDATEToText (0,0,tds, sDateTime, 256, iDate%)
vDateTime = Cdat( sDateTime)
NotesDocumentAddedToFile = vDateTime
End Function
Sample Usage:
Sub Click(Source As Button)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Dim doc As NotesDocument
Set db = s.CurrentDatabase
Set col = db.AllDocuments
Set doc = col.GetFirstDocument
Msgbox doc.subject(0) & " added: " & NotesDocumentAddedToFile(doc)
End Sub