CleanupInbox – moves older documents out of inbox
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Dim dr1 As notesdaterange
Dim v As notesview
Dim dc1 As NotesDocumentCollection
Dim gracedoc As NotesDocument
Dim stime1 As New NotesDateTime("0/0/0")
Dim etime1 As New NotesDateTime("Today")
Set gracedoc = db.GetProfileDocument("inboxgracedays")
Dim graceval As Variant
Dim gracedays As Integer
' if no profile doc has been prepared, default is 90 days
If gracedoc.HasItem("gracedays") Then
graceval = gracedoc.GetItemValue("gracedays")
gracedays = Cint(graceval(0))
Else
gracedays = 90
End If
etime1.AdjustDay(-1*gracedays)
' create a daterange excluding docs newer than graceperiod
Set dr1 = s.CreateDateRange()
Set dr1.StartDateTime = stime1
Set dr1.EndDateTime = etime1
'dc1: collection of 'old' documents from inbox
(before or on Today - gracedays)
Set v = db.GetView("($Inbox)")
Set dc1 = v.GetAllDocumentsByKey(dr1)
'pull out expired docs
dc1.RemoveAllFromFolder("($Inbox)")
End Sub
'SetInboxGracePeriod agent – sets the grace period for inbox
Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Dim gracedoc As NotesDocument
Dim gracedays As Integer
Dim inputgracedays As Integer
Dim maxdays As Integer
Dim graceval As Variant
Dim gracevar As Variant
maxdays = 1000
Set gracedoc = db.GetProfileDocument("inboxgracedays")
If gracedoc.HasItem("gracedays") Then
graceval = gracedoc.GetItemValue("gracedays")
gracedays = Cint(graceval(0))
Else
gracedays = 90
End If
getInput:
inputgracedays = -1
gracevar = Inputbox("Days to retain in Inbox? (currently " &
gracedays & ")" )
If (gracevar <> "") Then
inputgracedays = Cint(gracevar)
End If
While (inputgracedays > maxdays)
Msgbox("Maximum of " & maxdays
& " days exceeded")
Goto getInput
Wend
If inputgracedays <> -1 Then
gracedays = inputgracedays
End If
Set gracedoc = db.GetProfileDocument("inboxgracedays")
gracedoc.ReplaceItemValue "gracedays",gracedays
Call gracedoc.Save(False,False)
End Sub
清理收件夾的代理Code for CleanupInbox agent
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
What is LotusScript ?
sap_man
2020-02-26 06:32:28
Lotus Notes企業高級開發摘要
湖底冰火
2020-06-28 18:14:30
在LotusScript中處理UTF-8編碼的內容
最近工作需要,要完成一個基於Lotus Domino的網站。由於涉及混合語種問題,網站編碼基調定爲UTF-8,而且其中有部分需要用LotusS
hanle18
2020-06-13 17:35:30
Limits on numeric data representation in LotusScript
The following table lists the legal range of values for the numeric dat
hanle18
2020-06-13 17:35:30
處理給定數組,使該數組中沒有重複元素
navymei10220214
2020-06-13 03:44:24
LotusScript可以做什麼?
sap_man
2020-02-26 06:32:28
如何用LotusScript附加文檔
sap_man
2020-02-26 06:32:28
The basic of LotusScript Agent
sap_man
2020-02-26 06:32:28
LotusScript基礎
练气中期程序员
2020-02-23 05:25:20
利用 LotusScript 實現用 Lotus Domino 的數據生成圖形化的 Excel 報表
hanle18
2020-02-21 21:50:08
Domino中使用Lotus Script處理XML
hanle18
2020-02-21 21:49:58
利用 LotusScript 靈活操作 Lotus Notes 富文本域
hanle18
2020-02-21 21:49:58
Limits on array variables in LotusScript
hanle18
2020-02-21 21:49:58
如何使用LotusScript代理來發送HTML格式的郵件
hanle18
2020-02-21 21:49:58