Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email HTML document in body from Access 97 button click 1

Status
Not open for further replies.

eclipse33

Programmer
Apr 13, 2001
94
0
0
CA
Hi,

I have a standard HTML document.

From a click on a form I need to open an email, insert the email address on the form AND (here is the problem)...Insert the HTML code from the document into the body of the email. No attachment....

Anyone have any ideas?
eclipse33
 
this is the idea:

Dim oa As Outlook.Application
Dim mi As MailItem
' use the running outlook 98 application
Set oa = GetObject("", "outlook.application")
Set mi = oa.CreateItem(olMailItem)
mi.Recipients.Add "eclipse33@hotmail.com"
' use mi.Body = "plain text"
' or
mi.HTMLBody = &quot;<html><body><A HREF=&quot; _
& Chr(34) & &quot; _
& Chr(34) & &quot;>Tek-tips</A></body></html>&quot;
mi.Send
Set mi = Nothing
Set oa = Nothing
 
Hi hennep,

Will HTMLBody work in Access 97??

Thanks for your help
eclipse33
 
I used the code above with Access97 and Outlook98

 
Hmmm....I tried HTMLBody yesterday and I Access 97 didn't see it as a good command....maybe I have to have a certain library installed.

Thanks again
eclipse33
 
I only needed a reference to the Outlook Object Library.
The first time I tested the program I didn't see anything, I forgot the <body> tag
Are you sure your html code is allright ?
 
Yeah the html works fine...I will make sure the Outlook Object Library is there when I get to work. Maybe that was the problem. I will see in an hour or so when I get to work.

Thanks for your help
eclipse33
 
Hi again hennep

Still not working.

Microsoft Outlook 8.0 Object Library installed...do you have 9.0??

eclipse33
 
mi.HTMLBody shows up red as soon as I type it in. And it doesn't appear in the function drop down box.

Do you think I need 9.0 instead of 8??
 
sorry

its the &quot;Outlook 98 Type Library&quot;, msoutl85.olb
 
I hope the type library caused the problem

it's 15:30 here, going home, have a nice weekend
 
thanks hennep!

I will try the library...I also Think I may have found another way around it if the library doesn't work.

I will post it here later if it works for future reference.

Have a good weekend hennep
Thanks again
eclipse33
(only 10:30 am here [mad])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top