调整MailItem中粘贴的JPEG的大小 [英] Resize a pasted JPEG in a MailItem
本文介绍了调整MailItem中粘贴的JPEG的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试从Excel工作表发送图片,但是尺寸很小.
I am trying to send a picture from an Excel sheet, but the size is very small.
如何获得合适的尺寸(基本上是整个屏幕)?
How could I get a decent size (basically the whole screen)?
这是代码:
Sub send_as_a_pic()
'Copy range of interest
Dim r As Range
Set r = Range("B2:O23")
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
.To = "fernando.grespan@fernando.com"
.CC = ""
.BCC = ""
.Subject = "PAC 2017 sales up to date"
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
'With wordDoc.Range
' .LockAspectRatio = True
' .Top = wordDoc.Top
' .Left = wordDoc.Left
'.Height = wordDoc.RowHeight
'End With
End Sub
推荐答案
实际上非常简单,请在develloppez.com上找到答案:
it was actually pretty easy, find the answer on develloppez.com:
For Each shp In wordDoc.InlineShapes
shp.ScaleHeight = 90
shp.ScaleWidth = 90
Next
谢谢!
这篇关于调整MailItem中粘贴的JPEG的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文