Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-17-2019, 06:15 PM   #1
chuckcoleman
Newly Registered User
 
Join Date: Aug 2010
Location: Chicago Illinois suburb
Posts: 208
Thanks: 9
Thanked 7 Times in 3 Posts
chuckcoleman is on a distinguished road
Insert contents of HTML file into Outlook body

I have a HTML file, ďTrip Report-Email.htmlĒ, that I would like to insert into the body of an Outlook email message. The html file, ďTrip Report-Email.htmlĒ is generated by exporting an Access report to an html file. When the email gets sent, I want the email recipient to see in the body of the email the report. To be clear, I want the report displayed in the body of the email message looking just like it would if you had clicked on the html file. I don't want a link and I don't want an attachment.

Right now, the Subject and the text in the Body all work perfectly. What Iím having trouble with is taking the html file above and inserting it.

Is there any sample code or suggestions that I can take a look at to accomplish this?

I appreciate any help on this topic.

Thanks,

Chuck

chuckcoleman is offline   Reply With Quote
Old 10-17-2019, 06:23 PM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,963
Thanks: 57
Thanked 1,297 Times in 1,278 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Insert contents of HTML file into Outlook body

Hi Chuck. See if you could use something from here.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 10-17-2019, 07:30 PM   #3
Micron
AWF VIP
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 1,107
Thanks: 10
Thanked 222 Times in 210 Posts
Micron has a spectacular aura about Micron has a spectacular aura about
Re: Insert contents of HTML file into Outlook body

I have created html email body text to report record details simply by making all the html tags and content as part of the body. Would think you could do the same for your file content. Note that I'm not saying you can simply dump

<html><head><body>TEST</body></head></html>

and expect it to work. You build the entire email message object in code.
EDIT - should mention that I was using CDO to send the message but that probably doesn't matter. It's the building of the message body that is the trick.

__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
Old 10-17-2019, 09:38 PM   #4
Mark_
Longboard on the internet
 
Join Date: Sep 2017
Location: Not the middle of no where, but I can see the road to it from my house.
Posts: 2,048
Thanks: 20
Thanked 382 Times in 375 Posts
Mark_ will become famous soon enough Mark_ will become famous soon enough
Re: Insert contents of HTML file into Outlook body

How are you sending the Email now? What's the code?

If it is something that support HTML, you can loop through your record source to create the body as Micron has indicated. If it doesn't, you may have to change how you are doing it.

Mark_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook html body Gasman Other Software 5 05-21-2016 10:28 AM
insert HtML file in to body of email (inside loop email) GaryPanic Modules & VBA 9 05-06-2015 12:56 AM
Include Graphic File In Body Of Html E-mail TimTDP Modules & VBA 3 04-07-2011 05:46 AM
Access 2007 - Use Report or HTML file as body of Outlook email message Dummy2 Modules & VBA 1 11-12-2009 08:53 PM
Text file as Body of Outlook insanity Modules & VBA 3 10-09-2003 06:35 AM




All times are GMT -8. The time now is 12:52 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World