我正在尝试从Excel工作表发送图片,但是尺寸很小。

如何获得合适的尺寸(基本上是整个屏幕)?

这是代码:

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 = "[email protected]"
        .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上找到答案:

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


谢谢!

关于excel - 调整MailItem中粘贴的JPEG的大小,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45446208/

10-13 09:04