×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Hi I am copying data from Excel to

Hi I am copying data from Excel to

Hi I am copying data from Excel to

(OP)
Hi I am copying data from Excel to an email
I want to copy data from a range as an image and pop it into the email. This is working ok.
I also want to add some headings after the image in the body of the email. This also works ok.
BUT when I want copy the image to the email then add body headings under the image I can not seem to have both, only one or the other.

I am using the following code.

CODE -->

Sub Rprt()



'Copy range of interest
Dim r As Range

Set r = Range("A2:J69")
r.Copy

'Open a new mail item
Dim outlookApp As Outlook.Application
Set outlookApp = CreateObject("Outlook.Application")
Dim OutMail As Outlook.MailItem
Set OutMail = outlookApp.CreateItem(olMailItem)

'Get its Word editor
OutMail.Display
Dim wordDoc As Word.Document
Set wordDoc = OutMail.GetInspector.WordEditor

'To paste as picture
wordDoc.Range.PasteAndFormat wdChartPicture


    With OutMail
        .To = ""
        .CC = ""
        .BCC = ""
        .Subject = "Shut Execution Report"
        .HTMLBody = "<hr><h3>Safety</ht> <h5>(Details Here)</ht><h3>FRW</ht><h5>(Details Here)</ht> <h3>Critical Path</ht><h5>(Details Here)</ht> <h3>Emergent Work</ht><h5>(Details Here)</ht> <h3>General</ht><h5>(Details Here)</ht>"
                
        End With
       

End Sub 

If I comment the paste picture I get the body text im after. But I want the pictue then the body text underneath.

any help would be appreciated.

RE: Hi I am copying data from Excel to

(OP)
Went down a different path - Saved image as temp file, referenced it and added it into the body text with HTML.
All worked good

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close