请大家看看下面的代码,我保存文档的代码那里有问题??

奥爸 2003-11-21 08:02:15
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Set db=s.CurrentDatabase
Set doc = New NotesDocument(db)
doc.medianame="medianame"
doc.starttime="starttime"
Call doc.save(True,True)

我刚开始是成功的,后来不知道我改动了那里之后就不可以了,非常紧急
星期天要交了。
谢谢大家了
...全文
63 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoyuer0851 2003-11-22
  • 打赏
  • 举报
回复
同意楼上的俩位说法:
第2 个问题中,你删除后,那么那个文档肯定就是空的…………

其实好多时候可以自己调试,打印结果出来看看 …………
goodtf 2003-11-22
  • 打赏
  • 举报
回复
第一问题:加表单名,才可存入某表单中。doc.form="要存入的表单名"
第二问题:应是:
Set doc = view.GetFirstDocument()

While Not doc Is Nothing
doc.remove(True)
Set doc = view.getfirstdocument

Wend
'**view.Refresh
Call ws.ViewRefresh
xiaozhigood 2003-11-21
  • 打赏
  • 举报
回复
第一个问题,你在 Set doc = New NotesDocument(db) 后面,加个 doc.form=formname(表单名)
xiaozhigood 2003-11-21
  • 打赏
  • 举报
回复
这个地方绝对的错误:
While Not doc Is Nothing
Set doc = view.getnextdocument(doc)
doc.remove(True)
Wend

你最好是自己想一下看!!
奥爸 2003-11-21
  • 打赏
  • 举报
回复

下面是我删除视图中的文档的代码,为什么只能删除第一个文档呢
Dim session As New NotesSession
Dim curDb As notesdatabase
Dim docs As notesdocumentcollection
Dim doc As notesdocument
Dim view As notesview
Dim ws As New notesuiworkspace

Set curDb = session.currentdatabase
Set view = curDb.GetView("vodview")

Set doc = view.GetFirstDocument()

While Not doc Is Nothing

Set doc = view.getnextdocument(doc)
doc.remove(True)
Wend
'**view.Refresh
Call ws.ViewRefresh

535

社区成员

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

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