我試圖將一系列單元格複製爲圖片,將該圖片放入電子郵件中,然後使用Excel宏發送電子郵件。作爲圖像複製範圍並粘貼到Outlook中(結果很小/模糊)
我可以做所有這些,但是圖像比原始圖像更小/更模糊。我試過各種複製/粘貼方法,但結果是一樣的。
當我用副本手動複製圖片(如屏幕所示)而沒有宏,然後使用ctrl + v粘貼到Outlook,圖像看起來很好。
任何想法爲什麼會發生這種情況?
下面的代碼:
Sub SendMail()
Dim aOutlook As Object
Dim aEmail As Object
Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String
Dim rngeData As Range
Set aOutlook = CreateObject("Outlook.Application")
Set aEmail = aOutlook.CreateItem(0)
Set rngeData = Worksheets("Promo Sync").Range("A5:Y86")
'Copy Range
rngeData.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Dim wordDoc As Word.Document
Set wordDoc = aEmail.GetInspector.WordEditor
'Paste picture
aEmail.Display
wordDoc.Range.Paste
Set rngeAddresses = ActiveSheet.Range("AK2:AK23")
For Each rngeCell In rngeAddresses.Cells
strRecipients = strRecipients & ";" & rngeCell.Value
Next
'Set Subject
aEmail.Subject = "Promo Sync " & Now()
'Set Recipient
aEmail.To = strRecipients
'Send Mail
aEmail.Send
End Sub
使用PasteSpecial方法... – HA560
嘗試了所有這裏列出的數據類型選項: https://msdn.microsoft.com/en-us/library/office/ff197265.aspx – Fubudis
'CopyPicture' - >'在ChartArea上粘貼 - >'從圖表中保存圖像爲JPG格式 - >'在郵件正文中附加嵌入圖像。沒有模糊,沒有複製失敗的問題。 – cyboashu