Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Missing Rules 1 307
HP DP 7.03 and lotus collaboration suite 9 3 164
Domino not switching to TLS 1.0 4 802
Changing over from Lotus Approach v3 to MS Access 4 416
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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