I have an Access Database where I am trying to create a Lotus Notes e-mail from. The import factor here is that I do not want to send the e-mail, I just want Access to create it, attach an attachment and then display Lotus Notes so the user can then add any additional text they would like. The user then will have the hit send.
The code I have so far seems to be really close but I can not get over the last hurdle and was hoping someone could help me out.
Below is the code I have. Any suggestions are appreciated.
Dim session As NotesSession
Dim MailDb As NotesDatabase
Dim MailDoc As NotesDocument
Dim oAttachME As Domino.NotesRichTextItem
Dim oEmbedObj As Domino.NotesEmbeddedObject
Dim oNotesWS As NOTESUIWORKSPACE
Dim strAttachmentName As String
Dim uiws As Object
Dim uidoc As Object
'Purpose: Start a session to notes
Set session = CreateObject("Lotus.NotesSession")
Call session.Initialize(LotusPassword)
'Purpose: Open the mail database in Lotus Notes
Set MailDb = session.GetDatabase(ServerName, MailFile)
If MailDb.IsOpen = True Then
'Already open for mail
Else
Call MailDb.Open
End If
'Purpose: Set up the new mail document
Set MailDoc = MailDb.CreateDocument
strAttachmentName = ProPath & lstIssueAttachments.Column(1)
Set oAttachME = MailDoc.CreateRichTextItem("Body")
Set oEmbedObj = oAttachME.EmbedObject(1454, "", strAttachmentName)
Call MailDoc.ReplaceItemValue("Form", "Memo")
‘So by this point I think I have successfully created the e-mail with an attachment but now I have to open Notes in edit mode so the user can view the attachment and add any extra text they would like. Basically, I am not sure about this next portion of code.
Set uiws = CreateObject(“Notes.NotesUIWorkspace”)
Call uiws.EDITDOCUMENT(True, MailDoc) – Here is where I am getting my error. Access tells me Run-Time Error 7419 – Incorrect argument type: Object Expected.
Like I said, any help or suggestions is appreciated.
Thanks
Darren