如何同时把Outlook的excel范围粘贴到图片中去

请帮我解决这个问题。 我是这个领域的新手,我想从excel粘贴多个范围,并将其粘贴到Outlook电子邮件大小修改。 请帮帮我。 提前致谢!

这是我现在的代码:

Sub EmailSend() Dim rng As Range Dim OutApp As Object Dim OutMail As Object Dim StrBody As String StrBody = "Please see our current Report" Set rng = Nothing On Error Resume Next 'Only the visible cells in the selection 'Set rng = Selection.SpecialCells(xlCellTypeVisible) 'You can also use a fixed range if you want Set rng = Range("C4:D8").SpecialCells(xlCellTypeVisible) On Error GoTo 0 If rng Is Nothing Then MsgBox "The selection is not a range or the sheet is protected" & _ vbNewLine & "please correct and try again.", vbOKOnly Exit Sub End If With Application .EnableEvents = False .ScreenUpdating = False End With Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .To = "x" .CC = "x" .BCC = "x" .Subject = "RRF for Vendor Sourcing - " & Cells(3, 2) .HTMLBody = StrBody & RangetoHTML(rng) .Display 'or use .Display End With On Error GoTo 0 With Application .EnableEvents = True .ScreenUpdating = True End With Set OutMail = Nothing Set OutApp = Nothing End Sub 

这行代码是什么定义你的范围。

  Set rng = Range("C4:D8").SpecialCells(xlCellTypeVisible) 

您可以简单地定义另一个范围:

 Dim rng2 As Range Set rng2 = Range("J4:N8").SpecialCells(xlCellTypeVisible) 

然后使用第二个范围再次调用RangetoHTML():

 RangetoHTML(rng2) 

这将返回另一个string,你可以像这样连接:

  .HTMLBody = StrBody & RangetoHTML(rng) & "<br>" & RangetoHTML(rng2)