Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

  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…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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