Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default VIA Excel - Composing a Lotus Notes email without sending

I've got some code that sends an email through Lotus Notes. Through the
code, Excel specifies the recipient(s), the subject text, and the body text.
The email is then sent. What I'd like to be able to do is:
Just create / compose the email without sending it. I still want to
populate those areas mentioned, but I'd like to leave the new message open
for some modifications before sending. Does anyone know if this is
possible.

Thanks in advance.
Paul


Here is the code that I'm currently using.

Function SendEMailOnly()

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


On Error GoTo SendMailError

EMailSendTo = "Me"
EMailCCTo = "" '' Optional
EMailBCCTo = "" '' Optional
EmailSubject = ""

''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 is the first line."
.addnewline 1
.APPENDTEXT "Who's there?"
.addnewline 1
.APPENDTEXT "Hello"
.addnewline 2
.APPENDTEXT "Wazzup!"
.addnewline 1
.APPENDTEXT " Woo hoo!"
.addnewline 3
.APPENDTEXT "Cool"
.addnewline 1
.APPENDTEXT "Not Cool"
.addnewline 1
.APPENDTEXT " Oh No!"
.addnewline 2
.APPENDTEXT "This is the next to the last straw!"
.addnewline 1
.APPENDTEXT " Oh Yes!"
End With

objNotesField.addnewline 1

objNotesDocument.SaveMessageOnSend = True ' save in Sent folder
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


MsgBox "Your Lotus Notes message was successfully sent ..." & _
Chr$(13) & _
Chr$(13) & _
"A copy can be found in your Sent folder", vbInformation, "Email Send
Status"

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
--



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VIA Excel - Composing a Lotus Notes email without sending

Hi PCLIVE

For info about Notes see this site
http://www.excelkb.com/?cNode=1X5M7A

Maybe you find your answer there

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"PCLIVE" wrote in message ...
I've got some code that sends an email through Lotus Notes. Through the
code, Excel specifies the recipient(s), the subject text, and the body text.
The email is then sent. What I'd like to be able to do is:
Just create / compose the email without sending it. I still want to
populate those areas mentioned, but I'd like to leave the new message open
for some modifications before sending. Does anyone know if this is
possible.

Thanks in advance.
Paul


Here is the code that I'm currently using.

Function SendEMailOnly()

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


On Error GoTo SendMailError

EMailSendTo = "Me"
EMailCCTo = "" '' Optional
EMailBCCTo = "" '' Optional
EmailSubject = ""

''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 is the first line."
.addnewline 1
.APPENDTEXT "Who's there?"
.addnewline 1
.APPENDTEXT "Hello"
.addnewline 2
.APPENDTEXT "Wazzup!"
.addnewline 1
.APPENDTEXT " Woo hoo!"
.addnewline 3
.APPENDTEXT "Cool"
.addnewline 1
.APPENDTEXT "Not Cool"
.addnewline 1
.APPENDTEXT " Oh No!"
.addnewline 2
.APPENDTEXT "This is the next to the last straw!"
.addnewline 1
.APPENDTEXT " Oh Yes!"
End With

objNotesField.addnewline 1

objNotesDocument.SaveMessageOnSend = True ' save in Sent folder
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


MsgBox "Your Lotus Notes message was successfully sent ..." & _
Chr$(13) & _
Chr$(13) & _
"A copy can be found in your Sent folder", vbInformation, "Email Send
Status"

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
--



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default VIA Excel - Composing a Lotus Notes email without sending

Thanks Ron.

I went to your site first. And had just come from the site you just
provided prior to posting. I found that site in a Google search. There's
some interesting stuff there, but I didn't see what I'm looking for. I will
look through it some more.

Thanks again,
Paul

--

"Ron de Bruin" wrote in message
...
Hi PCLIVE

For info about Notes see this site
http://www.excelkb.com/?cNode=1X5M7A

Maybe you find your answer there

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"PCLIVE" wrote in message
...
I've got some code that sends an email through Lotus Notes. Through the
code, Excel specifies the recipient(s), the subject text, and the body
text. The email is then sent. What I'd like to be able to do is:
Just create / compose the email without sending it. I still want to
populate those areas mentioned, but I'd like to leave the new message
open for some modifications before sending. Does anyone know if this is
possible.

Thanks in advance.
Paul


Here is the code that I'm currently using.

Function SendEMailOnly()

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


On Error GoTo SendMailError

EMailSendTo = "Me"
EMailCCTo = "" '' Optional
EMailBCCTo = "" '' Optional
EmailSubject = ""

''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 is the first line."
.addnewline 1
.APPENDTEXT "Who's there?"
.addnewline 1
.APPENDTEXT "Hello"
.addnewline 2
.APPENDTEXT "Wazzup!"
.addnewline 1
.APPENDTEXT " Woo hoo!"
.addnewline 3
.APPENDTEXT "Cool"
.addnewline 1
.APPENDTEXT "Not Cool"
.addnewline 1
.APPENDTEXT " Oh No!"
.addnewline 2
.APPENDTEXT "This is the next to the last straw!"
.addnewline 1
.APPENDTEXT " Oh Yes!"
End With

objNotesField.addnewline 1

objNotesDocument.SaveMessageOnSend = True ' save in Sent folder
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


MsgBox "Your Lotus Notes message was successfully sent ..." & _
Chr$(13) & _
Chr$(13) & _
"A copy can be found in your Sent folder", vbInformation, "Email Send
Status"

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
--



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
Sending Excel Worksheet in 2007 to Lotus Notes Valerie Setting up and Configuration of Excel 1 May 20th 08 02:24 PM
Sending An Email To Web-Based Lotus Notes 7 SEAN DI''''ANNO Excel Discussion (Misc queries) 0 June 7th 07 10:16 AM
Mail über Lotus Notes aus Excel heraus/ Sending Mail with Excel through Lotus Notes [email protected] Excel Programming 0 February 19th 07 12:11 PM
Sending Excel sheet by Lotus Notes Will[_5_] Excel Programming 0 August 12th 03 12:19 PM
Sending Email using Lotus Notes Bob[_26_] Excel Programming 1 July 29th 03 07:31 PM


All times are GMT +1. The time now is 10:45 AM.

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"