NotesDocument datoer

datesDer findes 4 interessante datoer på et Notes Document:

  • Created in this file og Created initially
  • Modified in this file og Modified initially

Alle fire datoer kan aflæses via Lotus Script:

CreatedInitially = doc.Created
CreatedInThisFile = getAddedToFileStr( doc ).Lslocaltime
ModifiedInitially = doc.Getfirstitem("$Revisions").Lastmodified
ModifiedInThisFile = doc.Lastmodified

‘Created in this file’ datoen kræver et kald til API’et

Type TIMEDATE
	Innards(0 To 1) As Long
End Type
Declare Function ConvertTIMEDATEToText% Lib "nnotes" (ByVal IntlFormat&, ByVal TextFormat&, InputTime As TIMEDATE, ByVal retTextBuffer$, ByVal TextBufferLength%, retTextLength%)
Declare Sub NSFNoteGetInfo Lib "nnotes" (ByVal hNote&, ByVal member%, td As TIMEDATE)

Const NOTE_ADDED_TO_FILE = 13
Const MAXALPHATIMEDATE = 80

Function getAddedToFileStr(doc As NotesDocument) As NotesDateTime
	' --- This is the actual function
	Dim td As TIMEDATE
	Dim tdStr$
	Dim cbStr%
	
	' --- using hidden "Handle" property in NotesDocument class, grab TIMEDATE 
	NSFNoteGetInfo doc.Handle, NOTE_ADDED_TO_FILE, td
	
	' --- convert TIMEDATE to a string using standard "current" settings
	tdStr$ = String$(MAXALPHATIMEDATE + 1, 0)
	ConvertTIMEDATEToText 0&, 0&, td, tdStr$, MAXALPHATIMEDATE, cbStr%
	
	' --- return the NotesDateTime to the caller 
	Dim dt As New NotesDateTime( Left$(tdStr$, cbStr%) )
	Set GetAddedToFileStr = dt
End Function 

Skriv et svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *

*