the code being used here is using front
end classes and those front end classes are only supported in the actual
Notes client and not when we are using COM objects and that is what we
are using here. I'm surprised this worked for you at all in the 8.5
code stream.
The following should be rewritten to
not use the front end classes
Set workspace = CreateObject("Notes.NotesUIWorkspace")
Call workspace.EDITDOCUMENT(True, noDocument)
'Insert the body text before the signature
Set uiDocument = workspace.CURRENTDOCUMENT
Call uiDocument.GOTOFIELD("Body")
Call uiDocument.INSERTTEXT(strmsg & vbCrLf)
Also the command OpenMail is only valid
using COM either, we need to use OpenMailDatabase for COM.
Something like the following can be used.
It will not use the add the signature as the comments were indicating
but the signature can be appending to the body field using the NotesRichttextItem
append signature as well.
Sub SendWithLotus(Optional strsubject,
Optional strmsg, Optional strto, Optional strAttach, Optional strBlindCC)
Dim noSession As Object, noDatabase
As Object, noDocument As Object, uiDocument As Object
Dim obAttachment As Object, EmbedObject
As Object
Dim stSubject As Variant
Dim vaRecipient As Variant, vaMsg As
Variant
Dim strProfileEnableSignature As String,
BaseDir As String, strLen As Long
Dim DavArr As Variant
Const EMBED_ATTACHMENT As Long = 1454
On Error Resume Next
'BaseDir = "\\redacted\"
'Otherdir = "redacted\"
Set noSession = CreateObject("Notes.NotesSession")
set dir = noSession.GetDbDirectory
set noDatabase = dir.OpenMailDatabase
'Create the e-mail and the attachment.
Set noDocument = noDatabase.CreateDocument
Set obAttachment = noDocument.CreateRichTextItem("Body")
If Not IsMissing(strAttach) Then
BaseDir = strAttach
If Left(strAttach, 5)
= "https" Then
strLen
= Len(strAttach)
DavDir
= Replace(strAttach, "/", "\")
DavArr
= Split(DavDir, "\")
BaseDir
= "\\" & DavArr(2) & "@SSL\DavWWWRoot\" &
Right(DavDir, strLen - 34)
End If
Set EmbedObject = obAttachment.EmbedObject(EMBED_ATTACHMENT,
"", BaseDir)
End If
'Add values to the created e-mail main
properties.
With noDocument
.Form = "Memo"
.SendTo = strto
.Subject = strsubject
'.Body = strmsg 'Removed
so that the body can be added before the signature
.BlindCopyTo = strBlindCC
.SaveMessageOnSend = True
End With
call obattachment.AppendText(strmsg
& vbCrLF)
Call noDocument.Send(False)
'Release objects from the memory.
Set EmbedObject = Nothing
Set obAttachment = Nothing
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing
Set uiDocument = Nothing
WriteLog (strsubject)
MsgBox "The e-mail has been created
- please switch to your Notes client to send.", vbInformation
End Sub