Hi at all,

I have found a nice VBA code to transfer data from excel to lotus. But somehow It creates only calendar entries. The line to change it to other event types should be 'AppointmentType' but whichever value I chose it remains always the same. Has anybody experience with this type of code and can help me?

Sub LotusMeeting()

Dim EmailList As Variant
Dim session, db, NotesDoc As Object
Dim server, mailfile, user As String
Dim strETime As Date
Dim NDTstart As Object
Dim NDTend As Object
Dim EndTime As Date
Dim StartTime As Date
Dim MinsDuration As Date
Dim ProcessOwner As String
Dim ClientOwner As String
Dim MSubject As String 'Variable for storing meeting subject
Dim TempSubject As String
Dim Body As Variant

'Picks up the Endtime from the ExcelSheet

StartTime = Cells(5, 2)
MinsDuration = Cells(6, 2)
Body = Cells(7, 2)


'Picks up the Attendees Name from the ExcelSheet
ClientOwner = Cells(2, 2)
ClientOwner = ClientOwner '& "@yourdomain.com"
ProcessOwner = Cells(3, 2)
ProcessOwner = ProcessOwner '& "@yourdomain.com"

'Picks up the Subject of the meeting from the ExcelSheet
MSubject = Cells(4, 2)

Set session = CreateObject("Notes.NotesSession") 'Initializing Notes Session
user = session.UserName 'Current User Name

server = session.GetEnvironmentString("MailServer", True) 'User's mailing server name
mailfile = session.GetEnvironmentString("MailFile", True) 'User's mailing file path
Set db = session.GETDATABASE(server, mailfile) 'Get Handle of User's Mailing Database

'Creating Meeting Document - Send to the invitees
Set NotesDoc = db.CREATEDOCUMENT
strETime = MinsDuration
NotesDoc.ReplaceItemValue "Form", "Notice"
NotesDoc.ReplaceItemValue "NoticeType", "I"
NotesDoc.ReplaceItemValue "DispDur_2", MinsDuration
NotesDoc.ReplaceItemValue "Chair", user
NotesDoc.ReplaceItemValue "AltChair", user
NotesDoc.ReplaceItemValue "Topic", MSubject
TempSubject = "Invitation:" & MSubject & " (" & CStr(Format(StartTime, "mmm")) & " " & CStr(Format(StartTime, "d")) & " "
TempSubject = TempSubject & " " & CStr(Format(StartTime, "hh:mm AM/PM")) & ")"
NotesDoc.ReplaceItemValue "Subject", TempSubject
NotesDoc.ReplaceItemValue "Body", Body
NotesDoc.ReplaceItemValue "MeetingType", 1
NotesDoc.ReplaceItemValue "AppointmentType", "3"
NotesDoc.ReplaceItemValue "$PublicAccess", "1"

NotesDoc.ReplaceItemValue "StartTime", StartTime 'Start time of the meeting
NotesDoc.ReplaceItemValue "StartDateTime", StartTime
NotesDoc.ReplaceItemValue "CalendarDateTime", StartTime
NotesDoc.ReplaceItemValue "EndDateTime", strETime
NotesDoc.ReplaceItemValue "EndTime", strETime 'End time of the meeting

NotesDoc.SAVEMESSAGEONSEND = False
NotesDoc.ReplaceItemValue "SendTo", ClientOwner
NotesDoc.ReplaceItemValue "RequiredAttendees", ClientOwner
NotesDoc.ReplaceItemValue "CopyTo", ProcessOwner
NotesDoc.ReplaceItemValue "OptionalAttendees", ProcessOwner
NotesDoc.ReplaceItemValue "_ViewIcon", 133
NotesDoc.computeWithForm True, False
Call NotesDoc.Send(False)

'Modifying Meeting Document for saving in user's mail file
NotesDoc.ReplaceItemValue "Form", "Appointment"
NotesDoc.ReplaceItemValue "_ViewIcon", 158
NotesDoc.ReplaceItemValue "tmpOwnerHW", "0"
NotesDoc.ReplaceItemValue "Subject", MSubject
Call NotesDoc.RemoveItem("NoticeType")
Call NotesDoc.RemoveItem("AppointmentType")
NotesDoc.computeWithForm True, False
Call NotesDoc.Save(False, False)

'Closing objects to free memory
Set session = Nothing
Set db = Nothing
Set NotesDoc = Nothing
MsgBox ("I went to Lotus Notes Sir!")
End Sub