Computer Learning Zone CLZ Access Excel Word Windows

They cannot stop me. I will get my education, if it is in the home, school, or anyplace.

-Malala Yousafzai
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Sending Email from Microsoft Access    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Email Body Text Formatting
Gregg Moore 
     
4 years ago
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?
Alex Hedley  @Reply  
           
4 years ago
Is the Table Field set to Rich Text?
Alex Hedley  @Reply  
           
4 years ago
Gregg Moore OP  @Reply  
     
4 years ago
Yes it is!
Gregg Moore OP  @Reply  
     
4 years ago
This is the code

     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
  
    
    SPMail = Nz(DLookup("SPEmail", "StakeLookupQ", "StakeID=" & StakeID), "")
    HCMail = Nz(DLookup("HCEmail", "StakeLookupQ", "StakeID=" & StakeID), "")
    
   subject1 = Nz(DLookup("SubjectText", "EmailInfoT", "EmailID=" & "1"), "")
   subject2 = Nz(DLookup("SubjectBody", "EmailInfoT", "EmailID=" & "1"), "")
   subject3 = Nz(DLookup("SubjectSignature", "EmailInfoT", "EmailID=" & "1"), "")

  
  
    If SPMail = "" Then
        MsgBox "This customer does not have an email"
        Exit Sub
    End If

      
    If Me.StartDateSearch.Value <> "" Then
    vstartdate = "#" & Me.StartDateSearch.Value & "#"
    
    filter = "[Date]>=" & vstartdate & ""
    
    End If
    
    If Me.EndDateSearch.Value <> "" Then
    venddate =
Gregg Moore OP  @Reply  
     
4 years ago
End If
    
    If Me.EndDateSearch.Value <> "" Then
    venddate = "#" & Me.EndDateSearch.Value & "#"
    
    filter = filter & " AND "
    filter = filter & "[Date]<=" & venddate & ""
    
    vstake = [StakeID]
    filter = filter & " AND "
    filter = filter & "[StakeID]=" & vstake & ""
    
    'MsgBox filter
    
    End If
    
    DoCmd.OpenReport "ShiftLetterR", acViewPreview, , filter

    DoCmd.OutputTo acOutputReport, "ShiftLetterR", acFormatPDF, CurrentProject.Path & "\Cannery Stake Reminder Letter.PDF"
    
    SendEmail subject2 & subject3, SPMail, subject1, False, , CurrentProject.Path & "\Cannery Stake Reminder Letter.PDF"
    
Richard Rost  @Reply  
          
4 years ago
What SendEmail function are you using? Expert 20 or the Email Seminar?
Gregg Moore OP  @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 Moore OP  @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?
Richard Rost  @Reply  
          
4 years ago
You can still use HTMLBody and put regular non-formatted text in it. You just won't get any markups.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Sending Email from Microsoft Access.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/7/2026 8:14:03 PM. PLT: 1s