2013-03-26 236 views
1

这是我的脚本。我想在这个脚本中有两个日期和时间,所以当有人点击按钮应该有两个条目在收件日历中莲花笔记多个日历条目的按钮脚本

我真的很感谢在这个问题上的任何帮助。

Sub Click(Source As Button) 

    Dim s As New NotesSession 
    Dim db As NotesDatabase 
    Dim doc As NotesDocument 
    Dim subject As String 
    Dim maildoc As NotesDocument 
    Dim rtitem As NotesRichTextItem 
    Set db = s.CurrentDatabase 
    Set doc = New NotesDocument(s.CurrentDatabase) 
    Set maildoc = New NotesDocument(s.CurrentDatabase) 
    Set ritem = New NotesRichTextItem(maildoc, "Body") 

'Modify Subject, Location, Start Day and Time, End Day and Time before sending!! 
'######################################################################### 

    doc.subject = "test" 
    doc.location = "bangalore" 
    Set startdatetime = New NotesDateTime("03/26/2013 04:00:00 PM") 
    Set enddatetime = New NotesDateTime("03/24/2008 05:00:00 PM") 

'######################################################################### 


    doc.From = s.UserName 
    doc.Form = "Appointment" 
    doc.AppointmentType = "0" 
    doc.Chair = s.UserName 
    doc.StartDateTime = startdatetime.LSLocalTime 
    doc.EndDateTime = enddatetime.LSLocalTime 
    doc.CalendarDateTime = startdatetime.LSLocalTime 
    doc.TimeRange = Timevalue(doc.startdatetime(0)) & "-" & Timevalue(doc.enddatetime(0)) 
    doc.ExcludefromView = "D" 

    Call doc.ReplaceItemValue("_ViewIcon", 160) 
    Call doc.AppendItemValue("$BusyName", s.UserName) 
    Call doc.AppendItemValue("$BusyPriority", "1") 
    Call doc.AppendItemValue("$PublicAccess", "1") 
    Call doc.save(True,True) 

    Print "An entry for this event was successfully added to your calendar and an e-mail confirmation was sent." 
    Msgbox "Calendar successfully updated and e-mail confirmation sent.", 64, "Success" 

'Send e-mail confirmation 

    maildoc.Form = "Memo" 

'Modify Subject and Send to 
'############################################################################ 

    maildoc.Subject = "test to send multiple emails" 
    Dim recip(2) As Variant 
    recip(0) = "" 
    recip(1) = "" 

    maildoc.sendto = recip 

'############################################################################ 

    Call maildoc.Send(False) 

End Sub 
+1

你的问题是什么?当你现在运行这个脚本时会发生什么? – 2013-03-26 13:15:45

+0

那么脚本工作得很好..一旦他们点击按钮,无论日期和时间脚本中提到他们的日历。我想要的是在脚本中添加两个不同的日期,并且当点击它时,它应该在其日历中创建两个不同的条目。 – 2013-03-26 13:21:51

+0

您是否在谈论创建重复预约?即,同一时间和相同的细节,但在两个不同的日子? – 2013-03-26 17:48:59

回答

1

IBM已经发布了Lotus Notes日历约会模式here。如果您想在两天内创建重复预约,但每天都在同一天,请从第12页开始。有很多选项,但我认为您可能需要设置重复=“1 “,RepeatUnit =”C“并将RepeatCustom =设置为具有两个日期的数组。

1

IBM将发布的Lotus Notes C & S Schema doc移至here。上面找到的另一个链接是以前没有更新的版本。

除了添加ORGRepeat值“1”,要重复条目,您需要有3个并行的值列表:StartDateTime,EndDateTime和RepeatInstanceDates。最初,StartDateTime和RepeatInstanceDates项目将包含相同的值,因此您可以在创建该值时简单地使用该值。

CalendarDateTime项目还需要具有与上述列表相同数量的值,以便该条目将显示在日历的正确日期/时间。

w/you脚本存在的一个潜在问题是它将使用用户时区的时间。因此,如果任何用户在另一个时区并点击它,这些条目将被放置在错误的时间。您可以通过将3个字符的时区标识符放在值的末尾来解决该问题(例如“03/26/2013 04:00:00 PM PM EDT”)

您可能还想查看按钮脚本我发现here为另一个如何做到这一点的例子。