Calendar posting

I have developed an application that is a vacation approval workflow. It uses a group calendar once the vacation is approved, it is posted here on the calendar. How do I post approved date(s) to a user's personal calendar using LotusScript?

This library can be used to create personal calendar entries in a user’s mailfile,
including repeat entries. For our purposes we needed this to take calendar
related documents such as vacation requests and team room calendar entries
and create appropriate documents in the user’s personal mail file calendar.

Given the right parameters it can create most any type of calendar entry:
appointment, event, reminder, anniversary, or (very limited) even a meeting
(but because of the complexity involved in sending notifications to invitees and rooms/
resources such notifications are not supported – users should then be advised to
manually create such meeting invitations). It can also be used to link to a source
document and/or copy over rich text from a source document.

The following parameters are required for proper processing of an entry:

dbCal As notesdatabase = the database to create the calendar entry in
sUser As String = the full heirarchical name of the person to create the calendar for
sType As String = the type of calendar entry (“Appointment”, “Reminder”, “Even”, “Anniversary”, “Meeting”)
sSubject As String = the title/subject of the calendar entry
vCalStartDates As Variant = a list array containing the start date of the entry (or start dates if a repeat entry)
vCalEndDates As Variant = a list array containing the end date of the entry (or end dates if a repeat entry)
RepeatFlags As Variant = A five element array containing necessary details for repeat entries
‘RepeatFlags(0) = RepeatForUnit
‘RepeatFlags(1) = RepeatHow
‘RepeatFlags(2) = RepeatInterval
‘RepeatFlags(3) = RepeatUnit
‘RepeatFlags(4) = RepeatWeekends
Comment As String = the comment to be entered in the Body of the calendar entry
docLink As NotesDocument = a document to be linked into the Body of the calendary entry
IncludeLink As Boolean = True/False – specifies whether or not to include a doc link to the docLink document
RTFField As String = an rich text field from the linked doc to be copy into the Body of the calendar entry
Location As String = the location of the appointment/event

%END REM

Function createCalEntry(dbCal As notesdatabase, _
sUser As String, sType As String, sSubject As String, vCalStartDates As Variant, _
vCalEndDates As Variant, RepeatFlags As Variant, Comment As String, _
docLink As NotesDocument, IncludeLink As Boolean, RTFField As String,_
Location As String) As Boolean

‘if we are passed a linking document and the name of a rich text field
‘then process accordingly, else just write out the comment to the Body field
If Not(docLink Is Nothing) And RTFField <> “” Then
Call handleRichTextItem(docNew, docLink, IncludeLink, RTFField, comment)
Else
.Body = comment$
End If

‘This function will copy a rich text item from a source doc to the new calendar entry,
‘and it will also create a doc link to the source document if required.
‘Otherwise it will simply append the comment the Body field of the new calendar entry

Set rtitem = docLink.GetFirstItem(RTFField)
If Not(rtitem Is Nothing) Then ‘not a new doc, so we can access the rich text body field
If rtitem.GetUnFormattedText <> “” Then ‘see if we have data in the field
If IncludeLink = True Then
Call rtitem.CopyItemToDocument(DocTarget, “Body”)
Set rtitem = docTarget.GetFirstItem(“Body”)
Set rtnav=rtitem.CreateNavigator
If Not rtnav Is Nothing Then
Call rtnav.FindFirstElement(RTELEM_TYPE_TEXTPARAGRAPH)
Call rtitem.BeginInsert( rtnav, False ) ‘move to beginning of rich text item
Call rtItem.AppendText(comment$ & ” –>”)
Call rtitem.AppendDocLink( docLink, “Link” )
Call rtitem.AddNewline(2)
Call rtitem.AppendText(“—————————————————————————————“)
Call rtitem.AddNewline(2)
Call rtitem.EndInsert()
Call rtitem.update
End If
Else
Call rtitem.CopyItemToDocument(DocTarget, “Body”)
Set rtitem = docTarget.GetFirstItem(“Body”)
Call rtitem.AddNewline(2)
Call rtItem.AppendText(comment$)
End If
Else ‘either it’s a new document or there are no values in the field
Set rtitem = New NotesRichTextItem( docTarget, “Body” )
If Not(rtitem Is Nothing) Then
If IncludeLink = True Then
Call rtItem.AppendText(comment$ & ” –>”)
Call rtitem.AppendDocLink( docLink, “Link” )
Call rtitem.addnewline(2)
Call rtItem.AppendText(“———————————————————“)
Call rtitem.update
Else
docTarget.Body = comment$
End If
Else
docTarget.Body = comment$
End If
End If
End If

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 1 &nbspReply

There was an error processing your information. Please try again later.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy