高分求解LS搜索问题,我想搜索符合条件的文档并把它放到第一次使用后私有的文件夹中!源代码贴出来了!

happydeer
博客专家认证
2002-11-20 09:16:24
执行到Call dc.PutAllInFolder("QueryResults")总是报错:
Notes error:正在把所有有关的文档及其父文档一起加入到此文件夹中
(queryresults).

难道答复文档不能一起放入文件夹中?????

Sub Click(Source As Button)
Dim ws As NotesUIWorkspace
Dim s As NotesSession
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim dc As NotesDocumentCollection
Dim vw As NotesView
Dim vwe As NotesViewEntryCollection
Dim thetime As NotesDateTime
Dim srchstring As String
Dim thetitle As String
Dim theauthor As String
Dim thedept As String
Dim thedate As String
Dim datedir As String
Dim themax As String
Dim maxdocs As Integer
Dim titlecondition As String
Dim authorcondition As String
Dim departmentcondition As String
Dim datecondition As String

Set ws = New NotesUIWorkspace
Set uidoc = ws.CurrentDocument
Set s = New NotesSession
Set db = s.CurrentDatabase

Set vw = db.GetView("QueryResults")
Set doc = vw.GetFirstDocument
While Not(doc Is Nothing)
Call doc.RemoveFromFolder("QueryResults")
Set doc = vw.GetNextDocument(doc)
Wend
' Set vwe = vw.AllEntries
' Call vwe.RemoveAllFromFolder("QueryResults")

thetitle = uidoc.FieldGetText("FldTitle")
theauthor = uidoc.FieldGetText("FldAuthor")
thedept = uidoc.FieldGetText("FldDepartment")
thedate = uidoc.FieldGetText("FldCreated")
datedir = uidoc.FieldGetText("FldDateDirection")

If thetitle <> "" Then
titlecondition = "@Contains(FldTitle;""" + thetitle + """)"
End If

If theauthor <> "" Then
authorcondition = "FldAuthor = """ + theauthor + """"
End If

If thedate <> "" Then
datecondition = "@Created " + datedir + "[" + thedate + "]"
End If

srchstring = titlecondition

If srchstring <> "" And authorcondition <> "" Then
srchstring = srchstring + " & " + authorcondition
Else
srchstring = srchstring + authorcondition
End If

Set thetime = New NotesDateTime("1/1/1990")

Set dc = db.Search(srchstring, thetime, 0)
Call dc.PutAllInFolder("QueryResults")
End Sub
...全文
27 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
happydeer 2002-11-20
  • 打赏
  • 举报
回复
高手帮帮忙阿!
justle_domino 2002-11-20
  • 打赏
  • 举报
回复
Set dc = db.FTsearch(srchstring,0)
Call dc.PutAllInFolder("vw")
justle_domino 2002-11-20
  • 打赏
  • 举报
回复
你这样的搜索,写的很死的,不要用db.search,用ftsearch。
happydeer 2002-11-20
  • 打赏
  • 举报
回复
有两个搜索条件没用上,暂且不管它!
zjhkzy 2002-11-20
  • 打赏
  • 举报
回复
我同意楼上这位的
davidnim 2002-11-20
  • 打赏
  • 举报
回复
应该是可以这样做的。不过我自己没有试过。你可以试一下一个个放到文件夹中,看到哪一个文档出错。

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧