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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Data Access Pages through Outlook

Status
Not open for further replies.

AlexBeet

IS-IT--Management
Aug 2, 2001
12
GB
I have a data access page with pictures that I want to email to many people as the body of an email (Not an attachment). I currently use the File; Send To; Mail Recipient option when the page is displayed, which seems to reformat the Data Access Page and sends all text and pictures perfectly as the body of the message.
Does anyone know how to perform this Data Access Page reformating via VBA and insert it as the HTMLbody of an email?

ps I know how to send text and attachments via Outlook from Access but I just cannot figure out how to send a Data Access Page by VBA - The sendobject method does not work - the images are not shown in the email.

Thankyou

Alex
 
I struggled with this also. Thanks to someone from Tek-Tips, I discovered my problem. I was using the body property rather than the HTMLbody property. The following code is how I made it work. Note that the recipients will be able to edit the data sent to them, unless your data access page prevents them from doing so.
Code:
    Set objOutlk = createObject("Outlook.Application")
    Set objMail = objOutlk.createItem(0)
	
    objMail.To = strMailTo
    objMail.Subject = "YourSubject"
    objMail.HTMLbody = "YourHTMLcode"
    objMail.send

    set objMail = nothing
    Set objOutlk = nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top