Affichage des articles dont le libellé est Can someone help me with why this code isn't attaching the file attachment?. Afficher tous les articles
Affichage des articles dont le libellé est Can someone help me with why this code isn't attaching the file attachment?. Afficher tous les articles

Can someone help me with why this code isn't attaching the file attachment?

vendredi 24 avril 2015

The email is sending fine but no attachment. Can anyone help?

Private Sub Command219_Click()
Dim objAttachment As Object
Dim objMailDb As Object
Dim objMailDocument As Object
Dim objEmbedObject As Object
Dim objNotesSession As Object
Dim strMailDbName As String
On Error Resume Next
Set objNotesSession = CreateObject("Notes.NotesSession")
Set objMailDb = objNotesSession.GETDATABASE("", strMailDbName)
objMailDb.OPENMAIL
Set objMailDocument = objMailDb.CREATEDOCUMENT
objMailDocument.Form = "Memo"
objMailDocument.sendto = "ADDRESS"
objMailDocument.Subject = "TEST"
objMailDocument.Body = "TEST TEST TEST"
objMailDocument.SAVEMESSAGEONSEND = fSaveMailToTheSentFolder
If strFileAttachment <> "" Then
Set objAttachment = MailDoc.CREATERICHTEXTITEM("I:\My Offers\Pending Test.xls")
Set objEmbedObject = objAttachment.EmbedObject(1454, "", strFileAttachment, "I:\My Offers\Pending Test.xls")
End If
objMailDocument.SEND 0, strLotusNotesUserID
'Clean Up
Set objMailDb = Nothing
Set objMailDocument = Nothing
Set objAttachment = Nothing
Set objNotesSession = Nothing
Set objEmbedObject = Nothing
End Sub
Can someone help me with why this code isn't attaching the file attachment?

Labels