VBA attach file to invitation meeting in Lotus Notes

JestersTear

New Member
Joined
Feb 10, 2014
Messages
2
Hello. Is there any way to programatically (by VBA) add an attachment to an invitation meeting in Lotus Notes? A lot of google-ing did not clearly reveal the method. Below is my code which blocks at line '*** Call objNotesRichTextItem.EmbedObject(1454, "", Attachment1, "") ***


Sub Send_meeting_Invitation()

Attachment1 = "C:\Training_plan.xls"
Set Notes = CreateObject("Notes.NotesSession") ' create new messaje
UserName = Notes.UserName
Set Db = Notes.GETDATABASE(vbNullString, "names.nsf")
Set WorkSpace = CreateObject("Notes.NotesUIWorkspace")
Call WorkSpace.COMPOSEDOCUMENT(, , "Appointment")
Set uidoc = WorkSpace.CURRENTDOCUMENT 'UIDoc=CalenDoc

Call uidoc.FieldSetText("StartDate", "11.02.2014")
Call uidoc.FieldSetText("StartTime", "12:00:00")
Call uidoc.FieldSetText("EndDate", "11.02.2014")
Call uidoc.FieldSetText("EndTime", "12:30:00")
Call uidoc.FieldSetText("Subject", "Training plan")
Call uidoc.GotoField("Body")
Call uidoc.InsertText("Please find attached also the training plan.")
Call uidoc.InsertText("" + vbCrLf)
Call uidoc.InsertText("Thank you.")
Call uidoc.InsertText("" + vbCrLf)
Call uidoc.InsertText("" + vbCrLf)
Call uidoc.FieldSetText("EnterSendTo", john.doe@xyz.com)
Set objNotesRichTextItem = uidoc.Document.CREATERICHTEXTITEM("Body")
Call objNotesRichTextItem.EmbedObject(1454, "", Attachment1, "") 'here the code stops by generating Run-time error 91: Object variable or With block variable not set

uidoc.Refresh
uidoc.Save
uidoc.Close
End Sub


Thank you.
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top