CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  企业开发 >  Lotus

help: 删除文档

楼主babycranky(小星星)2002-05-09 11:36:47 在 企业开发 / Lotus 提问

Dim   s   As   New   notessession  
  Dim   db   As   notesdatabase  
  Set   db=s.currentdatabase  
  Dim   w   As   New   notesuiworkspace  
  Dim   uidoc   As   notesuidocument  
  Set   uidoc=w.currentdocument  
  Dim   view   As   notesview,   view1   As   notesview  
  Set   view=db.getview("chjguanli")  
  Set   view1=db.getview("chongxview")  
  Dim   doc   As   notesdocument  
  Set   doc=uidoc.document         //chjguanli视图中的当前文档  
  Dim   deldoc   As   notesdocument  
  Set   deldoc=view1.getfirstdocument  
   
  Messagebox(doc.xuehao(0))           //chjguanli中文档的xuehao域,但该显示框中无值??????  
  Messagebox(deldoc.xuehao(0))  
   
  Do   While   Not   (deldoc   Is   Nothing)  
  If   doc.xuehao(0)=deldoc.xuehao(0)   Then  
  Call   doc.remove(True)  
  Call   deldoc.remove(True)  
  End   If  
  Loop  
  问题点数:100、回复次数:4Top

1 楼woodsays(木头说)回复于 2002-05-09 12:07:23 得分 50

Dim   S   As   New   NotesSession  
  Dim   curDb   As   NotesDatabase  
  Dim   tmpView   As   NotesView  
  Dim   tmpDoc   As   NotesDocument  
   
  Set   curDb   =   S.currentDatabase  
  Set   tmpView   =   curDb.getView("AnswersCollection")  
  Call   DelAllDocs(tmpView)  
  Set   tmpView   =   curDb.getView("CategoryAnswer")  
  Call   DelAllDocs(tmpView)  
   
  'YOU   MAY   SEE   THE   FOLLOWING   CODE   !!  
  Sub   DelAllDocs   (viewName   As   NotesView)    
  Dim   tmpBeginDoc   As   NotesDocument  
  Dim   tmpNextDoc   As   NotesDocument  
   
  Set   tmpBeginDoc   =   viewName.getFirstDocument  
  Do   While   Not   (tmpBeginDoc   Is   Nothing)  
  Set   tmpNextDoc   =   viewName.getNextDocument(tmpBeginDoc)  
  If   Not   (tmpNextDoc   Is   Nothing)   Then  
  Call   tmpNextDoc.remove(True)  
  Else  
  Call   tmpBeginDoc.remove(True)  
  Exit   Do  
  End   If  
  Loop  
   
  End   SubTop

2 楼woodsays(木头说)回复于 2002-05-09 12:36:17 得分 0

DelAllDocs这段代码是删除指定VIEW中的所有文档。Top

3 楼fokker(独孤龙)回复于 2002-05-09 12:44:58 得分 20

你是要删除什么文档?Top

4 楼rosemerry(珏儿)回复于 2002-05-09 13:17:30 得分 30

少了else  
            set   deldoc=view1.getnextdocument,否则要死循环的!!  
  你找到了相同域值删除文档,如果没有找到还是对那个文档进行比较,会死循环!  
  显示框中无值?是视图中无值还是表单中无值?Top

相关问题

  • 关于文档的删除
  • 文档删除问题
  • 如何删除父文档已被删除的答复文档?
  • web上怎么实现删除文档???
  • 到期删除文档的代理
  • 如何删除文档模板?
  • 删除一个空的文档!!!
  • C/S下删除文档的问题
  • !!!请问如何删除文档????
  • 怎么实现主文档删除的同时该主文档的所有答复文档也一起删除?

关键词

  • 文档
  • view
  • db
  • deldoc
  • tmpbegindoc
  • tmpview
  • xuehao
  • curdb
  • notesdocumentset
  • tmpnextdoc

得分解答快速导航

  • 帖主:babycranky
  • woodsays
  • fokker
  • rosemerry

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo