Create Lotus appointment from Excel
Hi,
I am trying to write a code which takes entries of my Excel Calendar and transfers it to LotusNotes. I found this code:
Quote:
'Public Sub SendNotesAppointment(Username as string, Subject as string, attachment as string,
'recipient as string, Body as string, AppDate as Date, Duration as integer)
'This public sub will write an appointment to a persons diary
'Please specify person as first name lastname
'also change the servername to reflect the notes server name
Public Sub SendNotesAppointment(UserName As String, Subject As String, Body As String, AppDate As Date, Duration As Integer)
'Set up the objects required for Automation into lotus notes
Dim Maildb As Object 'The mail database
Dim MailDbName As String 'The persons notes mail database name
Dim CalenDoc As Object 'The calendar entry itself
Dim WorkSpace As Object
Set WorkSpace = CreateObject("Notes.NOTESUIWORKSPACE")
'Get the engineer username and then calculate the mail file name
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " ")))
MailDbName = "mail\" & Left$(MailDbName, 8) & ".nsf"
'Create a new calender appointment based on template and set the attributes.
Set CalenDoc = WorkSpace.COMPOSEDOCUMENT("SERVERNAME", MailDbName, "Appointment")
CalenDoc.FIELDSETTEXT "AppointmentType", "2"
CalenDoc.FIELDSETTEXT "StartDate", CStr(Format(Date, "dd/mm/yy"))
CalenDoc.FIELDSETTEXT "Duration", CStr(Duration)
CalenDoc.FIELDSETTEXT "Subject", Subject
CalenDoc.FIELDSETTEXT "Body", Body
CalenDoc.Save False, False, False
CalenDoc.Close
Set Maildb = Nothing
Set CalenDoc = Nothing
Set WorkSpace = Nothing
End Sub
The problem is that it doesn't seem to be a full finished code. Has anybody a completed code, which sends Excel entries to Lotus to create appointments or other calendar entries?