清理收件夹的代理Code for CleanupInbox agent
2011-10-19 14:06
267 查看
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
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
- CleanMyMac for Mac 3.9 beta 3 中文破解版下载 系统垃圾清理软件
- PhoneClean For Mac(IOS系统清理) v5.1.1.20180105中文破解版
- (Visual Studio)Part 4: Setting up Code for the Debugger
- Set up CodeBlocks for OpenCV
- 关于Error in PL/SQL block to clean upleftover entries for SDE instance ORA-06508....
- 用户代理及 java.io.IOException: Server returned HTTP response code: 403 for URL
- RMAN-07540: Cleanup is required for the VPC user schema
- Memory Clean for Mac(内存清理工具) v6.3最新破解版
- Playback.initialize does not clean up cause playback error for STA
- Windows Installer Cleanup卸载清理错误提示:Run-time error '-2147024882 (8007000e)' System Error &H80004005 (-2147467259). Unspecified er
- Codeforces Round #464 (Div. 2) A Determined Cleanup
- How To Automate Cleanup Of Dead Connections And INACTIVE 【如何自动清理ORACLE中的死连接和非活动会话】
- Item 15:Utilize using and try/finally for Resource Cleanup
- Effective C#之15:Utilize using and Try/finally for Resource Cleanup
- CleanMyDrive for Mac (清理你的磁盘) V2.1.6中文破解版
- Disk Clean Pro for Mac(磁盘清理工具)免激活版 v1.5破解版
- 如何解决svn清理失败 不能更新 cleanup失败 cleanup乱码 更新乱码 svn更新提示清理 清理乱码不能清理 svn故障修复SVN cleanup 陷入死循环 svn cleanup时遇到错误怎么办
- exchange 2003 clean up agent的作用。
- IntelliJ IDEA for CleanCode