CreateEmail Sub调用SaveToImage Sub。 SaveToImage子类获取范围,在新页面上创建图表,然后将图片(objChart)保存到指定目录。
LMpic字符串变量调用刚刚保存的图像并将其输入到HTML正文中。
Public Sub CreateEmail()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Dim FN, LN, EmBody, EmBody1, EmBody2, EmBody3 As String
Dim wb As Workbook
Dim ws As Worksheet
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set wb = ActiveWorkbook
Set ws = Worksheets("Sheet1")
Call SaveToImage
ws.Activate
LMpic = wb.Path & "\ClarityEmailPic.jpg'"
On Error GoTo cleanup
For Each cell In Columns("D").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" Then
FN = Cells(cell.Row, "B").Value
LN = Cells(cel