mikeellinas
New Member
- Joined
- Nov 7, 2017
- Messages
- 25
Hi. I have a Module that copies and pastes into a new outlook email:
Sub Email()
'Copy range of interest
Dim r As Range
Set r = Range("A1:E24")
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)
With outMail
.CC = "xxxxxx"
.Subject = "xxxxxxxx"
End With
'Get its Word editor
outMail.Display
Dim wordDoc As Word.Document
Set wordDoc = outMail.GetInspector.WordEditor
'To paste as picture
wordDoc.Range.PasteAndFormat wdChartPicture
End Sub
This works great for me with one exception. The image is small and blurry in the outlook window. When I manually re-size it larger in the outlook window before sending, it looks great. After re-sizing, I clicked on image properties and in the Layout/Size tab, it says Height is absolute 5.84"; Width is Absolute 12.27"; Scale Height and Width are both 80% with "lock aspect ratio" and "relative to original picture size" boxes both checked. The original size says 7.29" and original width says 15.28".
Can someone help me program the resizing to happen automatically as part of my module?
Sub Email()
'Copy range of interest
Dim r As Range
Set r = Range("A1:E24")
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)
With outMail
.CC = "xxxxxx"
.Subject = "xxxxxxxx"
End With
'Get its Word editor
outMail.Display
Dim wordDoc As Word.Document
Set wordDoc = outMail.GetInspector.WordEditor
'To paste as picture
wordDoc.Range.PasteAndFormat wdChartPicture
End Sub
This works great for me with one exception. The image is small and blurry in the outlook window. When I manually re-size it larger in the outlook window before sending, it looks great. After re-sizing, I clicked on image properties and in the Layout/Size tab, it says Height is absolute 5.84"; Width is Absolute 12.27"; Scale Height and Width are both 80% with "lock aspect ratio" and "relative to original picture size" boxes both checked. The original size says 7.29" and original width says 15.28".
Can someone help me program the resizing to happen automatically as part of my module?