【问题标题】:VBA - Picture Excel to Outlook with image resizeingVBA - 图片 Excel 到 Outlook 并调整图像大小
【发布时间】:2019-04-30 05:52:56
【问题描述】:

我整理了一个运行良好的代码,但是粘贴在电子邮件上的图片有点太小,我想把它放大,但我很难找到合适的代码。

另一个问题是签名就在图片旁边,而我希望它在下面几行。

谁能在我的代码中引入这两个功能?

Sub Print_and_send()
Dim Sht As Excel.Worksheet
Set Sht = ThisWorkbook.ActiveSheet

Dim rng As Range
Set rng = Sht.Range("D3:Y42")
    rng.CopyPicture Appearance:=xlScreen, Format:=xlPicture

Dim OutApp As Object
Set OutApp = CreateObject("Outlook.Application")

Dim OutMail As Object
Set OutMail = OutApp.CreateItem(0)

Dim vInspector As Object
Set vInspector = OutMail.GetInspector

Dim wEditor As Object
Set wEditor = vInspector.WordEditor


With OutMail
    .To = "youremail"
    .CC = "youremail"

    .Subject = "Test"
    .display


     wEditor.Paragraphs(2).Range.Paste



End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub

【问题讨论】:

  • 现在已经回答了这两个问题之一,您明白了为什么应该有两个单独的帖子。搜索者也更容易找到他们特定问题的相关答案。您可以编辑您的帖子以删除签名问题并尝试单独的主题问题。

标签: excel vba image outlook size


【解决方案1】:

你可以参考这段代码:

 For Each shp In wordDoc.InlineShapes
        shp.ScaleHeight = 90
        shp.ScaleWidth = 90
    Next

更多信息,请参考此链接:

Resize a pasted JPEG in a MailItem

【讨论】:

    猜你喜欢
    • 2021-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-21
    • 1970-01-01
    • 2011-10-24
    相关资源
    最近更新 更多