From: Phil on
Access 2010 having got this super RTF memofild, how do I Email it as the
body. The formated text is in a bound form EMailText and a bound field name
is also EMailText

Code is

..... Get outlook running
Set oItem = oOutlookApp.CreateItem(OLMailItem)

With oItem
'Set the recipient for the new email
.BCC = MailToStg
'Set the recipient for a copy
.cc = ""
'Set the subject
.Subject = Subject
'The content of the document is used as the body for the email

.Body = ""
'.HTMLBody = Forms!EMailText!EMailText ' Tried this
.RTFBody = Forms!EMailText!EMailText ' Tried this
.Send
End With
EMailMessage = True

If FlgQuit = True Then
oOutlookApp.Application.Quit
End If

CleanUp:
Set oItem = Nothing
Set oOutlookApp = Nothing
Exit Function

Err_EMailMessage:

If Err = 287 Then ' No to send email
MsgBox "Email not sent", vbInformation
Else
MsgBox Err.Description
End If
GoTo CleanUp

End Function

Have also tried

DoCmd.SendObject t acSendNoObject, , "html", , , "Phil(a)Stantonfamily.co,uk",
"Test", Forms!EMailText!EMailText
From: Arvin Meyer on
Try this:

.BodyFormat = olFormatHTML
.Body = ""
.HTMLBody = Forms!EMailText!EMailText


--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access
Co-author: "Access 2010 Solutions", published by Wiley


"Phil" <phil(a)stantonfamily.co.uk> wrote in message
news:1YKdnStt6-vWlc_RnZ2dnUVZ7v-dnZ2d(a)brightview.co.uk...
> Access 2010 having got this super RTF memofild, how do I Email it as the
> body. The formated text is in a bound form EMailText and a bound field
> name
> is also EMailText
>
> Code is
>
> .... Get outlook running
> Set oItem = oOutlookApp.CreateItem(OLMailItem)
>
> With oItem
> 'Set the recipient for the new email
> .BCC = MailToStg
> 'Set the recipient for a copy
> .cc = ""
> 'Set the subject
> .Subject = Subject
> 'The content of the document is used as the body for the email
>
> .Body = ""
> '.HTMLBody = Forms!EMailText!EMailText ' Tried this
> .RTFBody = Forms!EMailText!EMailText ' Tried this
> .Send
> End With
> EMailMessage = True
>
> If FlgQuit = True Then
> oOutlookApp.Application.Quit
> End If
>
> CleanUp:
> Set oItem = Nothing
> Set oOutlookApp = Nothing
> Exit Function
>
> Err_EMailMessage:
>
> If Err = 287 Then ' No to send email
> MsgBox "Email not sent", vbInformation
> Else
> MsgBox Err.Description
> End If
> GoTo CleanUp
>
> End Function
>
> Have also tried
>
> DoCmd.SendObject t acSendNoObject, , "html", , ,
> "Phil(a)Stantonfamily.co,uk",
> "Test", Forms!EMailText!EMailText


From: Phil on
On 31/07/2010 18:59:45, "Arvin Meyer" wrote:
> Try this:
>
> .BodyFormat = olFormatHTML
> .Body = ""
> .HTMLBody = Forms!EMailText!EMailText
>
>

Thanks for coming back, Arvin

The email got through OK but the message appeared as plain text rather than
formatted text. Not sure whether the formated memo field is RTF or HTML. I
know that on the EMailText field in the table, the format is set to RTF, but
I believe I read that it is actually HTML.
Non the less - progress.

Phil
From: Douglas J. Steele on
"Phil" <phil(a)stantonfamily.co.uk> wrote in message
news:5sKdnV0Or4TuQsjRnZ2dnUVZ7omdnZ2d(a)brightview.co.uk...
> On 31/07/2010 18:59:45, "Arvin Meyer" wrote:
>> Try this:
>>
>> .BodyFormat = olFormatHTML
>> .Body = ""
>> .HTMLBody = Forms!EMailText!EMailText
>>
> The email got through OK but the message appeared as plain text rather
> than
> formatted text. Not sure whether the formated memo field is RTF or HTML. I
> know that on the EMailText field in the table, the format is set to RTF,
> but
> I believe I read that it is actually HTML.

Yes, the so-called RTF field in Access 2010 is, in fact, HTML.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
Co-author: "Access 2010 Solutions", published by Wiley
(no e-mails, please!)




From: Phil on
On 31/07/2010 18:59:45, "Arvin Meyer" wrote:
> Try this:
>
> .BodyFormat = olFormatHTML
> .Body = ""
> .HTMLBody = Forms!EMailText!EMailText
>
>

Hi Arvin

Have re-checked and it works nearly perfectly. I suspect there is a sort of
bug in the memo field. My message is "This is a Rich Text Message in Access
2010" The "This is a Rich Text" is supposed to be in Tahoma 8 (the standard
font of the EMailText Field), "Message" in Showcard Gothic 24 and "in Access
2010" in red Seago Stript 14 In debug mode,
?Forms!EMailText!EMailText
<div>
This is a Rich Text
<font face="Showcard Gothic" size=6>message </font>
<font face="Segoe Script" size=4 color="#ED1C24">in Access 2010</font>
</div>
<div>
&nbsp;
</div>

So the initial 5 words does not get the format instruction. Consequently
those 5 words in the email come out as Times New Roman 12 in the EMail.

If I change the format of tose 5 words to Curlx MT then I get
?Forms!EMailText!EMailText
<div>
<font face="Curlz MT">This is a Rich Text </font>
<font face="Showcard Gothic" size=6>message </font>
<font face="Segoe Script" size=4 color="#ED1C24">in Access 2010</font>
</div>

<div>
&nbsp;
</div>

That works perfectly. Somehow I need to insert the font instructions into the
HTML string

Phil