Genii Weblog

Using FileCreated and FileModified in Midas

Tue 27 Sep 2005, 04:20 PM



by Ben Langhinrichs
I noticed that the Midas documentation shows the FileCreated property and FileModified property, it does not explain how to use them with all the different time type variables available in LotusScript.  These are the created and modified time for an attachment or embedded object, and can be very useful to know, but only if you can figure outhow to use them.  So, here is a short snippet I will add to the Help database soon:

Option Public
Option Declare
Uselsx "*lsxrtc"    
Sub Initialize
   DimAs New NotesSession
   Dim doc As NotesDocument
   Dim ret As Variant
   Dim ntime As NotesDateTime
   Set doc = s.DocumentContext
   Dim rtitem As New GeniiRTItem
   Dim rtchunk As GeniiRTChunk
   Call rtitem.ConnectBackend(doc.Handle, "Body", True)
   Set rtchunk = rtitem.DefineChunk("File 1")
   Print "File Size is& Cstr(rtchunk.FileSize) & " bytes"
   Print "File Created: " & Cstr(rtchunk.FileCreated)
   Print "File Modified: " & Cstr(rtchunk.FileModified)
   Set ntime = New NotesDateTime("")
   ntime.LSLocalTime = rtchunk.FileModified
   doc.FileWasModified = rtchunk.FileModified
   Call doc.Save(True, False)
End Sub

I hope that helps.

Copyright © 2005 Genii Software Ltd.

What has been said:

No documents found