不检查 Busytime 而自动接受邀请的代码样例

本文介绍了一段用于Lotus Notes的代码样例,该代码可以实现在不检查Busytime的情况下自动接受会议邀请的功能。适用于希望将邮件文件作为共享日历使用的场景。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

不检查 Busytime 而自动接受邀请的代码样例


环境

产品: Lotus Notes Designer
平台: Windows
软件版本: 6.5,6.0

问题

有些 IBM Lotus Notes/Domino 用户希望把一个邮件文件用做整个公司或某个地区的共享日历。他们希望会议邀请能被自动接受而不必检查是否有时间冲突。

解答

千万注意:下面是一段样例程序,只是提供了一个实现方法。Notes 技术支持部门不会根据某个用户的环境去定制这段代码。对用户来说这只是一个建议,并不属于 IBM Lotus 软件的支持范围内。

在数据库中创建一个新的代理,代理属性为:
共享
触发:按事件,新邮件到达后
包含以下代码:
Sub Initialize
On Error Goto ErrorHandler
Dim s As New NotesSession
Dim a As NotesAgent
Dim col As NotesDocumentCollection
Dim doc As NotesDocument, rptDoc As NotesDocument
Dim stDate As NotesItem

Set a = s.CurrentAgent
Set col = s.CurrentDatabase.UnprocessedDocuments()

Set doc = col.getfirstdocument
Do Until doc Is Nothing
If doc.Repeats(0) = "1" Then
'Save the main doc
doc.NoticeType = "A"
doc.Form = "Appointment"
doc.ReplaceItemValue "$CSFlags", "c"
doc.ReplaceItemValue "Subject", doc.GetItemValue("TOPIC")
doc.ReplaceItemValue "_ViewIcon", 158
doc.Save True, False
doc.RemoveFromFolder "($Inbox)"
'Create child document
Set rptDoc = s.CurrentDatabase.CreateDocument()
rptDoc.MakeResponse doc
doc.CopyAllItems rptDoc
rptDoc.ReplaceItemValue "StartDate", rptDoc.GetItemValue("StartDateTime")
rptDoc.ReplaceItemValue "StartTime", rptDoc.GetItemValue("StartDateTime")
Set stDate = rptDoc.GetFirstItem("RepeatDates")
rptDoc.CopyItem stDate, "RepeatInstanceDates"
rptDoc.CopyItem stDate, "StartDateTime"
rptDoc.CopyItem stDate, "CALENDARDATETIME"
rptDoc.ReplaceItemValue "EndDate", rptDoc.GetItemValue("EndDateTime")
rptDoc.ReplaceItemValue "EndTime", rptDoc.GetItemValue("EndDateTime")
Set stDate = rptDoc.GetFirstItem("RepeatEndDates")
rptDoc.CopyItem stDate, "EndDateTime"
rptDoc.ReplaceItemValue "OrgRepeat", "1"
rptDoc.ReplaceItemValue "ORGTABLE", "C0"
rptDoc.ReplaceItemValue "Repeats", "1"
rptDoc.ReplaceItemValue "$RefOptions", "1"
rptDoc.ReplaceItemValue "$CSFlags", "i"
rptDoc.Form = "Appointment"
rptDoc.Save True, False
Else
Set rptDoc = s.CurrentDatabase.CreateDocument()
rptDoc.MakeResponse doc
doc.CopyAllItems rptDoc
doc.NoticeType = "A"
Set stDate = rptDoc.GetFirstItem("StartDateTime")
rptDoc.CopyItem stDate, "CALENDARDATETIME"
rptDoc.Save True, False
doc.Save True, False
doc.RemoveFromFolder "($Inbox)"
End If
Call s.UpdateProcessedDoc(doc)
Set doc = col.GetNextDocument(doc)
Loop
Done:
Exit Sub

ErrorHandler:
Print "Error in agent AutoAccept in " & a.Parent.FilePath
Print "Error (" & Cstr(Err) & " on line " & Cstr(Erl) & "): " & Error
Resume Done
End Sub

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值