Solved

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

Posted on 2006-11-01
4
697 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

18 Experts available now in Live!

Get 1:1 Help Now