VBA that is adding picture to html body in outlook, but the picture size is all wrong

espenskeie

Well-known Member
Joined
Mar 30, 2009
Messages
636
Office Version
  1. 2016
Platform
  1. Windows
Hi

Does anyone know how I can get the correct picture size when I add a picture to the body. As you can see I have tried adding some size to the picture, but it didn't help, maybe I did something wrong. Picture is really big. Here's my part of code:


Code:
With OutMail
                    .To = "espen@calk.no" ' OBS!! Legg inn en dummymail her! cell.Value 'Scanner igjennom lista og sender privat mail, en mail pr adresse,
                                     ' slik at det ikke er nødvendig med .BCC
                    .cc = ""
                    .BCC = RecipientList
                    .Subject = "Morning notes - " & Stamp & ", Adept Markets"
                    .Attachments.Add (sFileName) ''' Dette er PDF-fila
                    .Attachments.Add (sFileName2) ''' Dette er denne excelboka
                    .Attachments.Add (sFileName1) '''Dette er GIF-fila
                    .HTMLBody = preStrBody & "src='cid:DailyReport.png'" & postStrBody  '& "width='1497' height='8997'>
"
                    
                    .NoAging = True
                                        
                    ' Tallet i parantes forteller hvilken konto du sender fra
                    .SendUsingAccount = OutApp.Session.Accounts.Item(1)
                    
                    .Display
                End With

Kind regards
Espen
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,215,137
Messages
6,123,253
Members
449,093
Latest member
Vincent Khandagale

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