Solved

Importing RTF into Notes Mail Message via VBA (not attach)

Posted on 2006-11-01
4
700 Views
Last Modified: 2013-12-18
Searching through the archives, I have figured out how to send an email via Lotus Notes  with attachment using VBA (Excel in this case).   Thankyou very much.   Now, I have one last hurdle to clear.  I want the accompanying mail message to have formatted text.  I was hoping to be able to import (not attach) an RTF document, but it is not working (line is Call notesrtf.EmbedObject(1453, "", "d:\temp\Word Rich Text.rtf") ).     This line results in a empty RTF 'Box' - not the contents of the file as I hoped.  Any help or guidance you can offer is appreciated.  Thanks.  

Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object



Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.getdatabase("", "")
Call notesdb.openmail


'Construct mail msg
Range(EmailCell).Select
strMail = Selection
Set notesdoc = notesdb.createdocument
Call notesdoc.replaceitemvalue("Sendto", strMail)
Call notesdoc.replaceitemvalue("Subject", EmailSubject)
Call notesdoc.replaceitemvalue("Principal", "Mickey Mouse")
Call notesdoc.replaceitemvalue("ReplyTo", "Minnie_Mouse@aon.com")
Call notesdoc.replaceitemvalue("DisplaySent", "Michael Eisner")



Set notesrtf = notesdoc.createrichtextitem("body")
'Call notesrtf.APPENDTEXT("Body of email goes here.")
'Call notesrtf.ADDNEWLINE(2)
'Call notesrtf.Appendrtfitem("d:\temp\Word Rich Text.rtf")   '<-----Problem is here


Rem attach file - Needs path
Call notesrtf.EmbedObject(1454, "", DestinationFilename)

'Send message
    notesdoc.SAVEMESSAGEONSEND = True
    'Keep the set following set to false (Not sure why, just leave it as is)
    notesdoc.SEND False

Set notessession = Nothing ' Release Memory
0
Comment
Question by:Sral
  • 3
4 Comments
 
LVL 63

Accepted Solution

by:
SysExpert earned 500 total points
ID: 17855201
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 17855220
0
 

Author Comment

by:Sral
ID: 17860602
If I do the cut/paste, wouldn't that write over the users clip board?
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 17860730
Probably.

I would simply warn them that this is going to hapen.

I can not see this as a major issue.



0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now