Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
div in email message
Klaas van Eijkern 
     
4 years ago
Hi team,

Below is a line from the VBA code for sending an e-mail via Outlook.
Sending out the email works fine.
However, the code <div> is shown in one of the fields in the email.
How can I solve that the code is no longer shown in the email?

VBA code:
EmailAanBedrijf = EmailAanBedrijf & "Beschrijving werkzaamheden: " & [Beschrijving werkzaamheden] & vbNewLine & vbNewLine

Example in e-mail message:
Beschrijving werkzaamheden: <div>Dit is een test voor teststraat</div>

Gr. Klaas
Alex Hedley  @Reply  
           
4 years ago
Are you sending the email as plain text or HTML?
Klaas van Eijkern OP  @Reply  
     
4 years ago
I send you the code:

DoCmd.SendObject acSendNoObject, , acFormatTXT, [EmailadresBedrijf], , , "Gegevens nieuw(e) of opgeloste storing/project", _
        "Hierbij ontvang je de gegevens van een nieuw(e) of opgeloste storing/project." & vbNewLine & vbNewLine & EmailAanBedrijf, True
Klaas van Eijkern OP  @Reply  
     
4 years ago
I have changed acFormatTXT to acFormatHTML, but still the same.
Kevin Yip  @Reply  
     
4 years ago
Your email client is set to compose emails in plain text only.  So it doesn't matter if you use acFormatTXT or acFormatHTML in Access, your email client will only use plain text.  The <div> tags are inside all rich text fields, and that's why they should up as text like that.  All email clients should have the setting of composing in HTML or plain text, and you should set it to HTML.  In Thunderbird, it looks like this:
Kevin Yip  @Reply  
     
4 years ago

Dan Jackson  @Reply  
            
4 years ago
On the back of Kevins post, Outlook:

Klaas van Eijkern OP  @Reply  
     
4 years ago
Hi Kevin and Dan,

My email settings in Outlook are in HTML format.
I think that the problem is in the difference between a text field in Long integer or Short integer. Because all filed with short integers work fine. The only field that shows the <div> tags is in the Long integer text field.

I hope that there is a solution for this.

Kevin Robertson  @Reply  
          
4 years ago
Hi Klaas,

See the Send Email Tech Help for a better way to send Email.
Also consider the Access Email Seminar.
Klaas van Eijkern OP  @Reply  
     
4 years ago
Hi Kevin,

I've already watched the video Send Email. Thanks for the reminder.
If I change the VBA code to the code as explained in this video, how do I insert all the fields necessary as shown underneath:

EmailAanMonteur = EmailAanMonteur & "E-mailadres: " & [E-mailadres] & vbNewLine
    EmailAanMonteur = EmailAanMonteur & "Taakummer: " & TaakNummer & vbNewLine
    EmailAanMonteur = EmailAanMonteur & "Type: " & [Type] & vbNewLine
    EmailAanMonteur = EmailAanMonteur & "Omschrijving: " & Omschrijving & vbNewLine & vbNewLine
    EmailAanMonteur = EmailAanMonteur & "Taak gemeld op: " & Gemeld_op & vbNewLine
    EmailAanMonteur = EmailAanMonteur & "Uitvoeringsdatum: " & Uitvoeringsdatum & vbNewLine & vbNewLine
    EmailAanMonteur = EmailAanMonteur & "Beschrijving werkzaamheden: " & [Beschrijving werkzaamheden] & vbNewLine & vbNewLine
    EmailAanMonteur = EmailAanMonteur & "Locatie Straat en nummer: " & LocatieStraat & " " & LocatieNummer & vbNewLine
    EmailAanMonteur = EmailAanMonteur & "Postcode en Plaats: " & LocatiePostcode & " " & LocatiePlaats & vbNewLine
    EmailAanMonteur = EmailAanMonteur & "Aanvullende informatie: " & LocatieAanvulling & vbNewLine
Kevin Robertson  @Reply  
          
4 years ago
The first parameter of the SendEmail Sub in the Global Module is MessageBody.
In your Button replace the variable 'Msg' with your body text (EmailAanMonteur).
Klaas van Eijkern OP  @Reply  
     
4 years ago
Great Kevin. Thank you very much.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Forum.
 

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: 5/7/2026 1:16:57 AM. PLT: 0s