Mapi - format message

Posted on 2005-04-06
Medium Priority
Last Modified: 2012-05-05
I am using MAPI to send e-mail automatically from and Access database. I have a table of standard messages. The field in the table is called "EMailMessage" and its type is Memo.
When creating the message in the table I format it, so for example it will look like this:
"Dear Sir
Thank you for you help
Kind regards

When creating the message I use the code:
MapiMessages.MsgNoteText = EMailMessage 'where EMailMessage is the message retreived from the database.

However the text comes out like this:
"Dear Sir Thank you for you help Kind regards TimP"

how can I keep its original format?
Question by:TimTDP
  • 2
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 13799921
You need to check how a DB memo field stores Carriage Return/LineFeed CRLF characters.

Then search the returned memo field for the correct delimiter & replace with vbCrLf  (o chr13+ chr10)

But as far as I know, the memo field should have the crlf in it.

Author Comment

ID: 13800134
I use Mozilla Thunderbird as my e mail client

Chr(10) and Chr(13) do not work. The correct code is "<br>"

LVL 32

Accepted Solution

Robberbaron (robr) earned 165 total points
ID: 13802904
Then i think you should walk through the text returned by the DB Memoi field & replace CRLF with <BR>

dim mf as string,i as integer,j as integer
for i=1 to len(mf)
  if mid(mf,i,2)=vbcrlf then
    mf=left(mf,i) & "<BR>" & mid(mf,i+2)
  end if
next i

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

862 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