Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sending mail to several recipients

9 views
Skip to first unread message

Cris, Portugal

unread,
Apr 23, 2003, 11:41:53 AM4/23/03
to
i'm using the code to send an attach file with lotus notes, but i need
help with this:

1. how can i send the mail to several recipients?
2. when i save the full path name, i must put a .xls at the end of the
file name or else i can't open it with lotus notes (notes dosen't
recognizes the file). Is it possible to save the file as an excel
format without righting the .xls extension?


' be sure to reference the Lotus Domino Objects, domobj.tlb
Dim objNotesSession As Object
Dim objNotesDatabase As Object
Dim objNotesDocument As Object
Dim objAttachment As Object
Dim objRichText As Object
Dim FullPath As String
Dim FileName As String
Dim Msg As String

Const EMBED_ATTACHMENT = 1454

Set objNotesSession = CreateObject("Notes.Notessession")
Set objNotesDatabase = objNotesSession.GETDATABASE("", "")
Call objNotesDatabase.OpenMail 'default mail database
If objNotesDatabase.IsOpen = False Then
MsgBox "Cannot connect to Lotus Notes."
Exit Sub
End If
Set objNotesDocument = objNotesDatabase.CreateDocument
Call objNotesDocument.ReplaceItemValue("Form", "Memo")

Sheets("COMISSÕES").Select
ActiveSheet.Copy
FullPath = Application.GetSaveAsFilename

ActiveWorkbook.SaveAs FullPath
FileName = ActiveWorkbook.Name

' assemble message
Set objRichText = objNotesDocument.CreateRichTextItem("Body")
Set objAttachment = objRichText.EmbedObject(EMBED_ATTACHMENT, "",
FullPath, FileName)
Msg = "Lotus Note sent from " & objNotesSession.CommonUserName
With objNotesDocument
.Subject = "Excel Lotus Note!"
.Body = Msg
.sendto = "cristina...@gfs.pt"
.SaveMessageOnSend = True ' save in Sent folder
.send (False)
End With

Set objNotesSession = Nothing
Set objNotesDatabase = Nothing
Set objNotesDocument = Nothing
Set objAttachment = Nothing
Set objRichText = Nothing

MsgBox "Your Lotus Notes message was successfully sent"
ActiveWorkbook.Close

Nick

unread,
Apr 23, 2003, 12:37:01 PM4/23/03
to
Take a look at Ron Debruin's webpage

http://www.rondebruin.nl/sendmail.htm

>.
>

0 new messages