[LotusNotes] 找回属于Louts Notes Inbox文件夹的 邮件

         很早的一个问题,因为模板替换的原因,导致用户 Inbox 文件夹中的邮件无法看到,但在All Documents 中却可以找到,遍寻方法,后再IBM网站上找了一段代码,放到Button控件下,执行后可找回 Inbox 中的邮件。

 Dim s As New notessession
 Dim db As notesdatabase
 Dim fDoc As NotesDocument ' Document in folder
 Dim ad As notesview ' All Documents view
 Dim aDoc As notesdocument ' document in All Docs view
 Dim fUNID() As String ' array of UNID's of docs in folders
 Dim i As Long ' UNID array index
 Dim deldate As notesitem
 Dim Chair1 As notesitem
 
 i =0
 Set db = s.CurrentDatabase
 
 Redim fUNID(0)
 
' Build UNID array by looping through folders, then their documents
 Forall view In db.views
  If view.IsFolder And Not view.Name=("($All)") Then
   Set fDoc = view.GetFirstDocument
   While Not fDoc Is Nothing
    Redim Preserve fUNID(i)
    fUNID(i) = fDoc.UniversalID
    i=i+1
    Set fDoc = view.GetNextDocument(fDoc)
   Wend
  End If
 End Forall
 
' Loop through docs in the All Documents view and compare UNIDs to each doc in the array
 Set ad = db.GetView("($All)")
 Set aDoc = ad.GetFirstDocument
 While Not aDoc Is Nothing
  i = 0
  Do While i <= Ubound(fUNID)
   If fUNID(i) = aDoc.UniversalID Then
    Exit Do
   End If
   i = i + 1
  Loop
  Set deldate = adoc.getfirstitem("delivereddate")
  Set Chair1 = adoc.getfirstitem("CHAIR")
  If i > Ubound(fUNID) And Not deldate Is Nothing And Chair1 Is Nothing Then
   Call adoc.PutInFolder( "($Inbox)")
  End If
  Set aDoc = ad.GetNextDocument(adoc)
 Wend

 

不用修改即可使用,恩,很好,很强大。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值