I am trying to create a tool that generates an invitation for a meeting using excel and lotus notes, and I am able to generate the email I want using code I found in StackOverflow and Lotus Notes API.
The only detail is that when I try to save the meeting in the calendar (without sending it. just save as a draft so someone could check the meeting details before sending the invitations) Lotus Notes will display the following message: .
Is there a way to remove this message so the user won't see this message? The code generating the meetings is below:
Private Sub salvaAppointment()
'Lotus notes objects
Set session = CreateObject("Notes.NotesSession")
Set Db = session.GetDatabase("", "")
'Prepare a document for the meeting
Call Db.OPENMAIL
Set doc = Db.CreateDocument
Set richText = doc.CreateRichTextItem("Body")
'Set meeting properties
Call doc.ReplaceItemValue("Form", "Appointment")
Call doc.ReplaceItemValue("AppointmentType", "3")
doc.Subject = "Reunião Caixa Rápido"
doc.CALENDARDATETIME = DateAdd("h", 15, Date)
doc.StartDateTime = DateAdd("h", 15, Date)
doc.EndDateTime = DateAdd("h", 17, Date)
doc.StartDate = Date
doc.Location = "Sala CCB"
'Email body
Call richText.AppendText("Modelo A3: ")
Call richText.AddNewLine(1, True)
modA3 = Application.ActiveWorkbook.Path & "\A3 Mod Modelo teste.ppt"
Call richText.EmbedObject(1454, modA3, modA3, "Attachment")
Call richText.AddNewLine(2, True)
Call richText.AppendText("**template**")
Call richText.Update
'Opens UI object to edit the document
Set UIWorkSpace = CreateObject("Notes.NotesUIWorkspace")
Set uidoc = UIWorkSpace.EDITDocument(True, doc)
'Fills meeting required destination
Set nomes = Range(Range("F1"), Range("F" & Rows.Count).End(xlUp))
For Each nome In nomes
Call uidoc.FieldAppendText("EnterSendTo", nome & ",")
Next nome
'Copy Excel cells to clipboard
Dim lastRow As Integer
lastRow = Range("E" & Rows.Count).End(xlUp).Row
Range("A1:E" & lastRow).Copy 'CHANGE SHEET AND RANGE TO BE COPIED AND PASTED
'Create a temporary Word Document
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = False 'True to aid debugging
Set wdTemplate = WordApp.Documents.Open(Application.ActiveWorkbook.Path & "\templateEmail.doc")
'Paste into Word document and copy to clipboard
With wdTemplate.Bookmarks
.item("tabela").Range.PasteSpecial DataType:=10
End With
With WordApp.Selection
.WholeStory
.Copy
End With
'Find the marker text in the Body item
uidoc.GotoField ("Body")
uidoc.FINDSTRING "**template**"
'Paste from clipboard (Word) to Lotus Notes document
uidoc.Paste
Application.CutCopyMode = False
WordApp.Quit False
'When I call the below line, it displays the message
Call uidoc.Save
uidoc.Close
'Liberar memória
Set session = Nothing
Set UIWorkSpace = Nothing
'Deleta as planilhas temporárias
Sheets("dados").Delete
Sheets("temp").Delete
End Sub
I appreciate any help.