Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default E-mail using Lotus Notes

Has anyone been able to use Excel to send an e-mail when
Lotus Notes is your e-mail system ?

I can get a new memo to come up with the correct address
within it, but I have not been able to populate the
subject or the message body.

Ultimately, what I want to be able to do is to walk down a
list of 500 names, and send each one an e-mail with the
same subject matter, and text, and then attach a small
Excel template to the mail.

I am told that we will move to MS exchange at some point -
but this has been tehcase for over a year !!

Any help would be gratefully received.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default E-mail using Lotus Notes

Try this - I have used Lotus Notes at several client sites and this has
worked for me with little or no amendment (watch out for line wrapping):

Dim objNotesSession As Object
Dim objNotesMailFile As Object
Dim objNotesDocument As Object
Dim objNotesField As Object

Function SendMail()

On Error GoTo SendMailError

EMailSendTo = " '' Required - Send to address
EMailCCTo = "" '' Optional
EMailBCCTo = "" '' Optional

''Establish Connection to Notes
Set objNotesSession = CreateObject("Notes.NotesSession")

''Establish Connection to Mail File
'' .GETDATABASE("SERVER", "FILE")
Set objNotesMailFile = objNotesSession.GETDATABASE("", "")
''Open Mail
objNotesMailFile.OPENMAIL

''Create New Memo
Set objNotesDocument = objNotesMailFile.CREATEDOCUMENT

''Create 'Subject Field'
Set objNotesField = objNotesDocument.APPENDITEMVALUE("Subject",
EMailSubject)

''Create 'Send To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("SendTo", EMailSendTo)

''Create 'Copy To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo", EMailCCTo)

''Create 'Blind Copy To' Field
Set objNotesField = objNotesDocument.APPENDITEMVALUE("BlindCopyTo",
EMailBCCTo)

''Create 'Body' of memo
Set objNotesField = objNotesDocument.CREATERICHTEXTITEM("Body")

With objNotesField
.APPENDTEXT "This e-mail is generated by an automated process."
.ADDNEWLINE 1
.APPENDTEXT "Please follow established contact procedures should you
have any questions."
.ADDNEWLINE 2
End With

''Attach the file --1454 indicate a file attachment
''objNotesField = objNotesField.EMBEDOBJECT(1454, "", "C:\Temp\test.xls")
objNotesField = objNotesField.EMBEDOBJECT(1454, "", ActiveWorkbook.FullName)

''Send the e-mail
objNotesDocument.Send (0)

''Release storage
Set objNotesSession = Nothing
Set bjNotesSession = Nothing
Set objNotesMailFile = Nothing
Set objNotesDocument = Nothing
Set objNotesField = Nothing

''Set return code
SendMail = True

Exit Function

SendMailError:
Msg = "Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & Chr(13) & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext

SendMail = False

End Function


--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"



"Alan Hutchins" wrote in message
...
Has anyone been able to use Excel to send an e-mail when
Lotus Notes is your e-mail system ?

I can get a new memo to come up with the correct address
within it, but I have not been able to populate the
subject or the message body.

Ultimately, what I want to be able to do is to walk down a
list of 500 names, and send each one an e-mail with the
same subject matter, and text, and then attach a small
Excel template to the mail.

I am told that we will move to MS exchange at some point -
but this has been tehcase for over a year !!

Any help would be gratefully received.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lotus Notes Steve Excel Discussion (Misc queries) 0 February 25th 09 08:27 PM
Send Mail with Lotus Notes tjtjjtjt Excel Discussion (Misc queries) 2 October 20th 05 01:08 AM
Sending e-mail with Lotus Notes pressing an excel button AndyOne Excel Discussion (Misc queries) 0 June 1st 05 09:29 PM
Sending Excel file as attachment to Lotus Notes mail Simon Lenn Excel Programming 2 December 9th 03 07:47 PM
Unable to CC more than one recipient when sending a Lotus Notes mail from Excel Dion McKnight Excel Programming 0 December 4th 03 12:39 PM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"