VBA excel email to outlook

mehdi1112

New Member
Joined
Oct 22, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi dears,

I am having my code in excel and i did macro on it, all works fine and perfect and it takes right picture.
The only thing i need to increase is the size of its pic when it's pasted into outlook email.
could you please help me to adjust its size?

Sub Send_Eur_margins()

Dim header As String
Dim tolist As String
Dim ccList As String
Dim Range As String

Dim htmlBodyText As String
Dim wb As Workbook

Application.ScreenUpdating = False

Set wb = ActiveWorkbook
wb.Sheets("EMAIL").Activate

header = Sheets("EMAIL").Range("W2").Value
tolist = Sheets("EMAIL").Range("W3").Value
ccList = Sheets("EMAIL").Range("W4").Value
Rangemail1 = Sheets("EMAIL").Range("W5").Value


htmlBodyText = "<br> <br> "
Set mailApp = CreateObject("Outlook.Application")
Set mail = mailApp.CreateItem(olMailItem)
mail.Display

Set wEditor = mailApp.ActiveInspector.wordEditor

Application.DisplayAlerts = False

On Error Resume Next
With mail
.To = tolist
.CC = ccList
.Subject = header
.HTMLBody = htmlBodyText
.Display

wb.Sheets("EMAIL").Activate



'Summary tab
.HTMLBody = .HTMLBody & "<font face=""tahoma"" color = ""#1F618D""> <br> <u><b></b></u>"



wb.Sheets("EMAIL").Range("A4:R124").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture




wEditor.Application.Selection.Start = Len(.HTMLBody)
wEditor.Application.Selection.End = wEditor.Application.Selection.Start
wEditor.Application.Selection.PasteAndFormat wdPasteBitmap


End With
On Error GoTo 0

Application.DisplayAlerts = True
Application.ScreenUpdating = True


End Sub


this is my macro.

Thanks alot in advance.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,223,888
Messages
6,175,208
Members
452,618
Latest member
Tam84

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
Back
Top