Lotus Notes send e-mail

L

Little Elvis

Hello,
I've tried the below code to send a e-mail with an attached .xls file
from VBA code in Access. (Access has the e-mail address to send each file to)
And I'm running to a authorization problem. Wonder if someone on here is also
a notes guru

Here is my code. One interesting thing I have noticed is that my notes
database should be (I think) mail\70\t00670.nsf but in the code when I look
it is mail\15\t00915.nsf - not sure if that is an issue..as the problem only
occurs when a attachment is added.


Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient
As String, BodyText As String, SaveIt As Boolean)
Dim Maildb As Object
Dim MailDbName As String
Dim MailDoc As Object
Dim AttachME As Object
Dim Session As Object
Dim EmbedObj As Object
Dim BODY As Object

Set Session = CreateObject("Notes.NotesSession")
Set Maildb = Session.GETDATABASE("", "") ' MailDbName)
If Maildb.ISOPEN = True Then
'Already open for mail
Else
Maildb.OPENMAIL
End If
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
Set BODY = MailDoc.CREATERICHTEXTITEM("Body")
BODY.APPENDTEXT BodyText
BODY.ADDNEWLINE (2)
If Attachment <> "" Then
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment)
End If
MailDoc.SAVEMESSAGEONSEND = SaveIt
MailDoc.PostedDate = Now()
MailDoc.SEND 0
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
End Sub


The problem occurs when it attempts to send the mail. I get a error 7000.
Authorization failure.

I'm also looking at a way of just adding a hyperlink to the files. Something
like file:\\<server>\<share>\<path>\<file>.xls instead of attaching to get
around this issue...and also to save space on the e-mail server.

Appreciate your help.

Sal.
 
P

Pete D.

Do you have Lotus Domino Objects selected in References. This is only a
slightly educated guess.
 
L

Little Elvis

Early binding doesn't work in VBA with lotus.

Pete D. said:
Do you have Lotus Domino Objects selected in References. This is only a
slightly educated guess.
 
L

Little Elvis

Oh well.. I solved it. My confiuration was actually pointing at someone
else's database! But I'm not sure why when I specified the server and
database..it still used the other person's??

Anyway sorted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top