Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lotus Notes Attachments vs Embedded Objects

Status
Not open for further replies.

M1N3773

Technical User
Jan 7, 2008
4
0
0
GB
Hi all, and a Happy New Year to everyone.

I have a problem I've been struggling with for ages. I have some code for sending an Excel file (from Excel VBA) via Lotus Notes, however, I need the file to be sent as an attachment, but it keeps sending it as an embedded object. I have looked at what feels like hundreds of forums, but I just cannot find an answer!!

Someone tested the code this morning and with the code unmodified, it came through as an attachment!!! So it worked, but I'm still no closer to an answer. At least it looks like it's not a code issue, but more like a version or settings issue. I am unable to find out the version of Lotus Notes that was used to send the test email. I am using version 6.0.2 CF2 on Windows XP.

Does anyone have any clues about how I could resolve this please? My curent code below:


Sub SendEmail()
Dim objMailDB As Object
Dim objMailDoc As Object
Dim objSession As Object
Dim objMailRTF As Object
Dim objAttach As Object
DDMMYY = Format(Now, "DDMMYY")
ChDirNet ActiveWorkbook.Path
namefile = ActiveWorkbook.Path & "\WPR_BANG_WC_" & DDMMYY & "_NUD_DISP.xls"

Dim recip(2) As Variant
recip(0) = "clmsra@nn.co.uk"
recip(1) = "m.c@nn.co.uk"

Set objSession = CreateObject("Notes.NotesSession")
Set objMailDB = objSession.GETDATABASE("", "")

If objMailDB.IsOpen = True Then
Else: objMailDB.OPENMAIL
End If

Set objMailDoc = objMailDB.CREATEDOCUMENT
With objMailDoc
.Form = "Memo"
.SendTo = "clmsra@nn.co.uk"
.Subject = "Weekly Performance Reports - " & DDMMYY
.Body = "Please find this week's WPR." & Chr(13) & _
"" & Chr(13) & _
"Thanks"
.SAVEMESSAGEONSEND = True
End With

Set objMailRTF = objMailDoc.CREATERICHTEXTITEM("Attachment")
Set objAttach = objMailRTF.EMBEDOBJECT(1454, "", namefile, "Attachment")
With objMailDoc
.PostedDate = Now()
.SEND 0, recip
End With

Set objMailDB = Nothing
Set objMailDoc = Nothing
Set objSession = Nothing
Set objMailRTF = Nothing
Set objAttach = Nothing
End Sub
 
Hi
Sorry if I'm being dim, I've just tried this ok - does this not work ?

Sub SendEmail()

ActiveWorkbook.SendMail recipients:="A Person"

End Sub
 
Hi, yes it does work, if you want embedded objects. However, as I stated in my post above, someone tested the code and with the code unmodified, it came through as an attachment!!! But when I run the exact same code, it comes through as an embedded object.

So it worked, and at least it looks like it's not a code issue, but more like a version or settings issue. I am unable to find out the version of Lotus Notes that was used to send the test email. I am using version 6.0.2 CF2 on Windows XP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top