Lotus记录视图:检索上次打开的时间

时间:2015-02-13 15:58:20

标签: lotus-notes

上次打开视图时是否有方法/技巧? 在设计师中,如果我右键单击视图,在“信息”选项卡中有一个参数'访问',我认为这与我正在寻找的相符。 有一种方法可以重现这个价值吗?

1 个答案:

答案 0 :(得分:5)

下面的代码将给出" Last Accessed"数据库中每个视图的日期和时间。请注意(根据帮助文件)此值不准确超过24小时,就好像在24小时内多次访问文档一样,最后访问的值不会更新。

Dim db As NotesDatabase
Dim s As New NotesSession
Dim nc As NotesNoteCollection
Dim doc As NotesDocument
Dim ID As String
Dim title As string

Set db = s.Currentdatabase
Set nc = db.createNoteCollection(False)

nc.Selectviews = true
Call nc.Buildcollection()
id = nc.Getfirstnoteid()
While Not id = ""
    Set doc = db.Getdocumentbyid(id)
    title = doc.getitemvalue("$Title")(0)
    Print title & ": " & doc.Lastaccessed
    id = nc.Getnextnoteid(id)
Wend

对一个特定视图执行相同的操作:

Dim db As NotesDatabase
Dim s As New NotesSession
Dim nc As NotesNoteCollection
Dim doc As NotesDocument
Dim ID As String
Dim title As String
Dim view As NotesView

Set db = s.Currentdatabase
Set view = db.GetView("MyViewName")
Set nc = db.createNoteCollection(False)

Call nc.Add(view)
Call nc.Buildcollection()
id = nc.Getfirstnoteid()
While Not id = ""
    Set doc = db.Getdocumentbyid(id)
    title = doc.getitemvalue("$Title")(0)
    Print title & ": " & doc.Lastaccessed
    id = nc.Getnextnoteid(id)
Wend