sxhall

Board Regular
Joined
Jan 5, 2005
Messages
155
Hi,

The below is part of a larger macro than generates an e-mail with an image from an Excel sheet as well as some text and the file as an attachment.

VBA Code:
Set OutMail = OutApp.CreateItem(0)
    With OutMail
        Set olInsp = .GetInspector
        Set wdDoc = olInsp.WordEditor
        Set oRng = wdDoc.Range
        .BodyFormat = 2
        .To = sTo
        .CC = sTo2
        .BCC = ""
        .Subject = "Scan Report - " & Format(Now(), "dd/mm/yy")
        .Body = "All," & vbCr & vbCr & "Please find attached to this email the 'Scan Report' for the " _
        & Format(Now(), "dd/mm/yy") & "." & vbCr & vbCr & "Regards" & vbCr & vbCr & Myname
        oRng.collapse 1
        oRng.Paste
        .Attachments.Add ActiveWorkbook.FullName
        .Display
    End With

What I need to do is have the image after the text! I have tried reordering hte above but it then does not add the .Body part of the code or the image.

Any help with how to have the e-mail format as the .Body part first and then the oRng.Paste after would be appreciated.

Thanks in advance

Steven
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,147,481
Messages
5,741,400
Members
423,657
Latest member
Medrok2021

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top