通过关键字打开相应的文档的问题,请大家帮忙

stupidfrog 2003-10-09 04:41:00
一个域meetnum,当我在阅读的时候根据这个域的内容从视图里得到相应文档的id,然后根据id打开文档,可是只有在编辑状态时才可用,下面是我的代码。

aa:=meetnum;
unid:=@DbLookup("";"";"Meetsummary";aa;3);
url:="/Resource.nsf/Meetsummary/"+unid+"?opendocument";
@URLOpen(url)
我试着在前面加@commond([editdocument];1)把文档转变成编辑状态或许会成功,可结果还是不行。请大家帮帮忙,我在线等。谢谢!
...全文
55 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
stupidfrog 2003-10-10
  • 打赏
  • 举报
回复
up
stupidfrog 2003-10-10
  • 打赏
  • 举报
回复
up
stupidfrog 2003-10-09
  • 打赏
  • 举报
回复
tozhanyunpeng:
如果是在一个编辑状态的表单中在meetnum中输入文本,就可根据文本得到预想的结果。我不知道问题出在什么地方。错误是出在点击之后,因为我是在帧结构中打开,所以没有显示的最终地址,上面的地址仍然是帧结构的地址?OpenFrameset
zhanyunpeng 2003-10-09
  • 打赏
  • 举报
回复
如果是点击之后出现的错误,你可以查看一下错误页面最终的地址是什么,因为我觉得你的@dblookup应该能计算出来UNID的,我想是不是相对链接错误
stupidfrog 2003-10-09
  • 打赏
  • 举报
回复
我在线等
谢谢各位
stupidfrog 2003-10-09
  • 打赏
  • 举报
回复
是404错误,说未找到文件
zhanyunpeng 2003-10-09
  • 打赏
  • 举报
回复

读状态时出现什么错误了呢?是整个页面根本就打不开(500错误),还是链接错误(404错误)
yw5525 2003-10-09
  • 打赏
  • 举报
回复
代码:这只是个例子,你回去在改改
'按关键字搜索
Dim s As New NotesSession
Dim context As NotesDocument
Dim db As NotesDatabase

Dim searchString As String

Dim comString As String

Dim boardView As NotesView
Dim boardDoc As NotesDocument

Dim specialView As NotesView
Dim specialDoc As NotesDocument

Dim totalDocs As Integer
Dim totalResp As Integer

Dim forumView As NotesView
Dim forumDoc As NotesDocument

Dim loopk As Integer

Dim totalMatchDoc As Integer

Dim forumID As String

Dim respView As NotesView
Dim respDoc As NotesDocument

Set context = s.DocumentContext
Set db = s.CurrentDatabase

Set boardView = db.GetView("NotesBoardManage")

Set respView = db.GetView("WebRePost")
Set respDoc = respView.GetFirstDocument()

totalDocs = 0
totalResp = 0
totalMatchDoc = 0

'先找到视图
comString = context.BoardKey(0)

Set boardDoc = boardView.GetFirstDocument()

While Not(boardDoc Is Nothing)
If (boardDoc.BoardName(0) = comString) Then
Set specialView = db.GetView(boardDoc.BoardViewAlias(0))
forumID = boardDoc.BoardNo(0)
End If
Set boardDoc = boardView.GetNextDocument(boardDoc)
Wend


'得到视图中文档数目
Set specialDoc = specialView.GetFirstDocument()

While Not(specialDoc Is Nothing)
totalDocs = totalDocs + 1

While Not(respDoc Is Nothing)
If (specialDoc.UniversalID = respDoc.NUID(0)) Then
totalResp = totalResp + 1
End If
Set respDoc = respView.GetNextDocument(respDoc)
Wend

Set specialDoc = specialView.GetNextDocument(specialDoc)
Wend



'传递搜索的关键字
searchString = context.QueryKey(0)

Set specialDoc = specialView.GetFirstDocument()

'==================================================================
'打印表头
Print "<TABLE cellSpacing='1' cellPadding='4' width='80%' align='center' bgColor='#666666' border='0'>"

Print "<tr>"
Print "<td bgcolor='#FF9930' colspan='3'><font color='#FFFFFF' size='3'>  <b>搜索板块" & "<font color='#000000'>" & comString & "</font>" & "结果如下:</font></b></td></tr>"

Print "</tr>"
Print "<td bgcolor='#E1E1E1' width='60%'>标题</td>"
Print "<td bgcolor='#E1E1E1' width='20%'>发表时间</td>"
Print "<td bgcolor='#E1E1E1' width='20%'>作者</td></tr>"


'===================================================
'保存搜索到的文档数目
totalMatchDoc = 0


'在视图中比较输入的字符串和标题,如果标题中“包含”输入的字符串,则是搜索结果之一
For loopk = 1 To totalDocs

Set tmpDoc = specialView.GetNthDocument(loopk)

'比较是否包含
If Instr(1,tmpDoc.Title(0),searchString,5) > 0 Then
totalMatchDoc = totalMatchDoc + 1
Print "<tr>"
Print "<td width='60%' bgcolor='#F7F7F7'>"

Print "<a href='TopicDetail?OpenForm&UID=" & tmpDoc.UniversalID & "&ForumID=" & forumID & "&MainDoc=" & Cstr(totalDocs) & "&RespDoc=" & Cstr(totalResp) & "'>"
Print tmpDoc.Title(0)
Print "</a>"
Print "</td>"
Print "<td width='20%' bgcolor='#F7F7F7'>" & Cstr(tmpDoc.LastModified) & "</td>"
Print "<td width='20%' bgcolor='#F7F7F7'>" & tmpDoc.PostUserName(0) & "</td>"
Print "</tr>"
End If

Next


If (totalMatchDoc = 0) Then
Print "<tr><td bgcolor='#FF9930' align='center' colspan='3'><font color='#FFFFFF'>^_^ 没找到匹配的帖子。</font></td></tr>"
Print "<tr><td bgcolor='#FF9930' align='center' colspan='3'>【<font color='#FFFFFF'><a href='javascript:history.back()'>返回</a></font>】</td></tr>"
Else
Print "<tr><td bgcolor='#FF9930' align='center' colspan='3'><font color='#FFFFFF'>^_^ 找到匹配的帖子共 " & totalMatchDoc & " 个。</font></td></tr>"
Print "<tr><td bgcolor='#FF9930' align='center' colspan='3'>【<font color='#FFFFFF'><a href='javascript:history.back()'>返回</a></font>】</td></tr>"
End If


Print "</table>"
yw5525 2003-10-09
  • 打赏
  • 举报
回复
你这个,要用LOTUScript 来做,写个 代理
yw5525 2003-10-09
  • 打赏
  • 举报
回复
好象,@dblookup,不能这么用呀

535

社区成员

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

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