i have a user that needs the text of the email body to have at least some rich text formatting. rather than straight text. I have created a table with some rich text fields so user can update what they want. I have a form that they use which creates a pdf report for the group they want to send report for. I set it up using your automated email function and it sends the file to the intended people but the body of the email is not formatting correctly. It comes out straight text with the formatting codes as well. I changed the format from olformathtml to olformatrichtext in the subroutine with fo difference. I also tried putting in a html formatted text into the table field but still only comes out this straight text with formatting codes and no formatted text in the Outlook email. Is this not possible to do this way? What am I doing wrong?
Dim SPMail As String
Dim filter As String
Dim vstartdate As String
Dim venddate As String
Dim vstake As Long
Dim subject1 As String
Dim subject2 As String
Dim subject3 As String
Dim HCMail As String
What SendEmail function are you using? Expert 20 or the Email Seminar?
Gregg MooreOP
@Reply 4 years ago
I haven't had a chance to subscribe to either yet. I got the following from one of your extended cut videos.
Public Sub SendEmail(SubjectBody As String, RecipientEmail As String, Subject As String, _
Optional SendImmediately As Boolean = True, _
Optional CCopy As String, _
Optional AttachmentFile As String = "", _
Optional AttachmentFile2 As String = "", _
Optional AttachmentFile3 As String = "")
' Remember to add REFERENCE to Microsoft Outlook Object Library
' If you get the Outlook warning message remember to just UPDATE WINDOWS DEFENDER
Dim O As Outlook.Application
Dim M As Outlook.MailItem
Set O = New Outlook.Application
Set M = O.CreateItem(olMailItem)
With M
.BodyFormat = olFormatHTML
'.RTFBody =
'.BodyFormat = olFormatRichText
'.RTFBody = SubjectBody
'.RTFBody = Mess
Kevin Robertson
@Reply 4 years ago
Greg,
You should get your proper formatting if you change from .RTFBody to .HTMLBody.
Gregg MooreOP
@Reply 4 years ago
I agree with you, however users do not have an easy way to update the information (which becomes the text body) in HTML. Do you know of a simple way they might be able to do this?
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.