Combining bit & peices from different discussion forums, I created this program (see below) to send meeting invitation from Lotus Notes using VBA. Program successfully sends the invitation to all required parties but throws the following error when I try to process meeting counters or if I try to cancel the meeting from my calendar.
"Unable to send mail; multiple matches found in Name & Address Book(s)"
I removed all entries in my local address book to avoid any conflicts. Interesting I am able to perform mail functions with the calendar entry (like send memo to invities).
The bottom line is that I can't perform calendar functions once I send out the invitations.
Can someone help with figure out why this is happening? I would really appreciate your help.
__________________________________________________ ___________
- Function CreateNotesMeeting()
-
On Error GoTo ErrorHandler
-
Dim objNotesSession As Object
-
Dim objNotesDbDirectory As Object
-
Dim objNotesDatabase As Object
-
Dim objNotesDocument As Object
-
Dim objNotesRichTextItem As Object
-
Dim StrBody As String
-
Dim Username As String
-
Dim StartTime As String
-
Dim EndTime As String
-
Dim arrRequiredAttendeeName As String
-
Dim arrRequiredAttendeeNameAndEmail As String
-
-
Username = GetCurrentUserName()
-
StrBody = "Testing Invitation"
-
StartTime = "3/22/08 01:30:00 PM"
-
EndTime = "03/22/08 02:30:00 PM"
-
-
AttendeeNameAndEmail = ""&Username & "/PGV/JD"
-
-
Set objNotesSession = CreateObject("Notes.NotesSession")
-
Set objNotesDatabase = objNotesSession.GETDATABASE("ServerName", "MAIL\" &Username & ".NSF")
-
-
If Not objNotesDatabase.ISOPEN Then Exit Function
-
Set objNotesDocument = objNotesDatabase.CREATEDOCUMENT
-
-
Set objNotesDtFrom = objNotesSession.CREATEDATETIME(StartTime)
-
Set objNotesDtTo = objNotesSession.CREATEDATETIME(EndTime)
-
Set objNotesRichTextItem = objNotesDocument.CREATERICHTEXTITEM("Body")
-
-
-
Call objNotesDocument.REPLACEITEMVALUE("AppointmentType", "3")
-
Call objNotesDocument.REPLACEITEMVALUE("Form", "Appointment")
-
Call objNotesDocument.REPLACEITEMVALUE("Subject", "Another Test - Counter")
-
Call objNotesDocument.REPLACEITEMVALUE("Location", "Test")
-
Call objNotesDocument.REPLACEITEMVALUE("Room", "Test")
-
Call objNotesDocument.REPLACEITEMVALUE("Body", StrBody)
-
Call objNotesRichTextItem.EMBEDOBJECT(1454, "", "C:\Test\Test.snp", "")
-
Call objNotesDocument.REPLACEITEMVALUE("From", objNotesSession.Username)
-
Call objNotesDocument.REPLACEITEMVALUE("Chair", objNotesSession.Username)
-
Call objNotesDocument.REPLACEITEMVALUE("$Alarm", 1)
-
Call objNotesDocument.REPLACEITEMVALUE("$AlarmOffset", -30)
-
Call objNotesDocument.REPLACEITEMVALUE("CalendarDateTime", objNotesDtFrom.LSLOCALTIME)
-
Call objNotesDocument.REPLACEITEMVALUE("STARTDATETIME", objNotesDtFrom.LSLOCALTIME)
-
Call objNotesDocument.REPLACEITEMVALUE("EndDateTime", objNotesDtTo.LSLOCALTIME)
-
Call objNotesDocument.APPENDITEMVALUE("RequiredAttendees", AttendeeNameAndEmail)
-
Call objNotesDocument.APPENDITEMVALUE("AltRequiredNames", AttendeeNameAndEmail)
-
Call objNotesDocument.APPENDITEMVALUE("INetRequiredNames", AttendeeNameAndEmail)
-
Call objNotesDocument.APPENDITEMVALUE("xSendTo", AttendeeNameAndEmail)
-
Call objNotesDocument.APPENDITEMVALUE("NoticeType", "I")
-
Call objNotesDocument.REPLACEITEMVALUE("$UpdatedBy", objNotesSession.Username)
-
Call objNotesDocument.REPLACEITEMVALUE("_ViewIcon", 158)
-
-
Call objNotesDocument.Send(False, AttendeeNameAndEmail)
-
Call objNotesDocument.Save(True, True)
-
-
Set objNotesRichTextItem = Nothing
-
Set objNotesDtTo = Nothing
-
Set objNotesDtFrom = Nothing
-
Set objNotesDocument = Nothing
-
Set objNotesDatabase = Nothing
-
Set objNotesDbDirectory = Nothing
-
Set objNotesSession = Nothing
-
-
Exit Function
-
-
ErrorHandler:
-
MsgBox Err.Number & " - " & Err.Description
-
-
End Function
__________________________________________________ ________________