是否有文档或简单的解决方案,可以使用外部服务器代理激活用户邮件文件中的外出服务?
我试过这样做,但它不工作…
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim dt As New NotesDateTime(Now)
Set db = s.Getdatabase("SERVERNAME", "MAILFILE")
Set doc = db.Createdocument()
doc.AppointmentType= "2"
doc.BookFreeTime = ""
doc.CreatedByAgent = "1"
doc.ExcludeFromView = "D"
doc.Form = "Appointment"
doc.From = s.Username
doc.Principal = s.Username
Call doc.Replaceitemvalue("$BusyName","")
Call doc.Replaceitemvalue("$BusyPriority","")
Call doc.Replaceitemvalue("$PublicAccess","1")
doc.ApptUNID = doc.Universalid
Call dt.Adjustday(-5)
set doc.EndDate = dt
set doc.EndDateTime = dt
call dt.Adjustday(10)
set doc.StartDate = dt
set doc.STARTDATETIME = dt
doc.Subject = "Out Of Office"
Call doc.Replaceitemvalue("$UpdatedBy",s.Username)
Call doc.save(True,False)
Set doc = db.Getprofiledocument("OutOfOfficeProfile")
Call dt.Adjustday(-5)
Set doc.FirstDayOut = dt
Call dt.Adjustday(10)
Set doc.FirstDayBack = dt
doc.CurrentStatus = "1"
doc.GeneralSubject = "HE IS NOT AVAILABLE"
Call doc.save(True,false)
UPDATE(将应答从离开办公室代理激活更改为离开办公室服务激活):
查找MailFile ScriptLibrary OutOfOfficeLib
在类OutOfOfficeObj
方法EnableService()
。这是你必须适应并放入你的代理的代码。
加上代码行
Call db.SetOption( DBOPT_OUTOFOFFICEENABLED, True)
您激活离开办公室服务。你可能还需要做一些其他的设置。只要按照EnableService()
中调用的方法,找出真正需要的是什么。
这是一个很好的描述如何激活和如何处理离开办公室服务的问题。例如,用户离开办公室服务状态的变化可能只有在向用户发送电子邮件后才能看到。
这就是它的工作方式。
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim dt As New NotesDateTime(Now)
Set db = s.Getdatabase("SERVER", "MAILFILE")
Set doc = db.Getprofiledocument("OutOfOfficeProfile")
Call dt.Adjustday(-5)
Set doc.FirstDayOut = dt
Set doc.StartTime = dt
Call dt.Adjustday(10)
Set doc.FirstDayBack = dt
Set doc.EndTime = dt
doc.CurrentStatus = "1"
doc.GeneralSubject = "MESSAGE"
doc.TaskState = "1"
doc.CurrentSate = "1"
doc.ShowHours = ""
Call doc.Computewithform(false, false)
Call doc.save(True,false)
Call db.SetOption( DBOPT_OUTOFOFFICEENABLED, True)