求高手指点

yuhao0201 2012-05-15 02:02:11
Sub Initialize
On Error GoTo errormsg
Dim curdb As NotesDatabase
Dim Up_number As String,mobile As String,content As string
Dim notedoc As NotesDocument
Dim session As New NotesSession
Dim Agent As NotesAgent
Set agent = session.CurrentAgent
Set curdb=session.Currentdatabase
MsgBox "222222222"
Set notedoc = curdb.GetDocumentByID(agent.ParameterDocID)
MsgBox "333333333333"
Set Sms=New Meipwebserviceserverporttype_n4
'sid=Sms.Login("nfjdejmh", "nfjdejmhgmcc")
Up_number=notedoc.Up_number(0)
mobile=notedoc.mobile(0)
content=notedoc.content(0)
Call notedoc.Remove(true)
Call SmsApproval(Up_number,mobile,content) 'content Y+同意,N+不同意

Exit sub
errormsg:
MsgBox "SmsApprovalJava Error:" & Str(Erl) & " " & Error
End Sub

为什么我执行到Set notedoc = curdb.GetDocumentByID(agent.ParameterDocID)时,执行不下去而报有“Invalid Note id”这个错呢
...全文
82 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuhao0201 2012-05-15
  • 打赏
  • 举报
回复
查看了一下帮助文档,确实如你所说的那样,
If agent.RunOnServer(doc.NoteID) = 0 Then
Messagebox "Agent ran",, "Success"
Else
Messagebox "Agent did not run",, "Failure"
需要带一个参数条件才可以执行的。
谢谢了
yuhao0201 2012-05-15
  • 打赏
  • 举报
回复
查看了一下帮助文档,确实如你所说的那样,
If agent.RunOnServer(doc.NoteID) = 0 Then
Messagebox "Agent ran",, "Success"
Else
Messagebox "Agent did not run",, "Failure"
需要带一个参数条件才可以执行的。
谢谢了
fare2000 2012-05-15
  • 打赏
  • 举报
回复
这个代理必须使用这样的代码被调用:
Dim Agent As NotesAgent
Set curdb=session.Currentdatabase
set Agent = curdb.GetAgent("这个代理")
Call Agent.RunOnServer(doc.NoteID)
'doc是你要传给代理处理的那个文档的Note ID, 这样那个agent.ParameterDocID参数才有效。

536

社区成员

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

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