在电子邮件介绍后插入屏幕截图

Insert a screenshot after an email introduction

我正在使用下面的代码,它基本上截取了用户表单的屏幕截图并将其粘贴到 Outlook 应用程序中。宏运行正常。

我想实现的是先发个邮件介绍,然后贴上截图,但是我做不到,因为截图没有放在正文后面。

这是我的代码

Sub Screenshotemail()

    Dim doc                   As Object, rng As Range

    Application.SendKeys "(%{1068})"
    DoEvents

    'ActiveSheet.Paste
    With CreateObject("Outlook.Application").CreateItem(0)
         Set doc = .GetInspector.WordEditor
         doc.Range(0, 0).Paste
        .display
        .To = ""
        .CC = ""
        .Body = "Dear All, " & Chr(10) & Chr(10) & "I kindly remind you that forecasts for program " & Chr(10) & Chr(10) _
         & "Please enter your forecast at the link below." _
         & Chr(10) & Chr(10) & lien & Chr(10) & Chr(10) & "Best Regards,"
        .Subject = "Test:"
        .Importance = olImportanceHigh
    End With

End Sub

有没有办法让它起作用?

我的朋友,我花了几个小时,但我想它有效

只需使用 htmlbody 代替正文,并在您的消息后连接 htmlbody

参考

子截图邮箱()

Dim doc As Object, rng As Range
Dim wdDoc As Object
Dim wdRange As Range

Application.SendKeys "(%{1068})"
DoEvents
Set wdDoc = CreateObject("Word.Application")
'ActiveSheet.Paste
With CreateObject("Outlook.Application").CreateItem(0)
    Set doc = .GetInspector.WordEditor
    doc.Range(0, 0).Paste
    .display
    .To = ""
    .CC = ""
    .htmlbody = "Dear All, " & Chr(10) & Chr(10) & "I kindly remind you that forecasts for program " & Chr(10) & Chr(10) _
     & "Please enter your forecast at the link below." _
     & Chr(10) & Chr(10) & lien & Chr(10) & Chr(10) & "Best Regards," & .htmlbody
    .Subject = "Test:"
    .Importance = olImportanceHigh
End With

结束子