Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-11-01
4
Medium Priority
?
728 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 63

Accepted Solution

by:
SysExpert earned 2000 total points
ID: 17855201
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

670 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