求助,excel vba 调用outlook代码问题 20
Subrr()DimolAppAsOutlook.ApplicationDimolMailAsOutlook.MailItemDimi%,j%,k%DimragAsRan...
Sub rr()
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
Dim i%, j%, k%
Dim rag As Range
a = 2
Set olApp = New Outlook.Application
Set rag = Cells(1, 4)
With Sheet2
For i = 2 To [d65536].End(xlUp).Row
If Cells(i + 1, 4) <> Cells(i, 4) Then
Set rag = Union(rag.EntireRow, Range(Cells(a, 4), Cells(i, 4)).EntireRow)
rag.Copy
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.Subject = "绩效评价表"
'给邮件正文赋值,问题点,我想把rag.copy复制的内容复制到邮件的正文,请高手指点下这的代码如何写,谢谢
.body = rag.Paste
.To = Cells(i,5)
.Send
End With
a = i + 1
Sheet1.Select
Set rag = Cells(1, 4)
End If
Next
End With
Set rag = Nothing
Set olMail = Nothing
End Sub
请高手帮忙改改红色注解的问题点,也就是把EXCEL里复制的表格粘贴到outlook正文的代码如何写,不会,在线等待高手指教,谢谢 展开
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
Dim i%, j%, k%
Dim rag As Range
a = 2
Set olApp = New Outlook.Application
Set rag = Cells(1, 4)
With Sheet2
For i = 2 To [d65536].End(xlUp).Row
If Cells(i + 1, 4) <> Cells(i, 4) Then
Set rag = Union(rag.EntireRow, Range(Cells(a, 4), Cells(i, 4)).EntireRow)
rag.Copy
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.Subject = "绩效评价表"
'给邮件正文赋值,问题点,我想把rag.copy复制的内容复制到邮件的正文,请高手指点下这的代码如何写,谢谢
.body = rag.Paste
.To = Cells(i,5)
.Send
End With
a = i + 1
Sheet1.Select
Set rag = Cells(1, 4)
End If
Next
End With
Set rag = Nothing
Set olMail = Nothing
End Sub
请高手帮忙改改红色注解的问题点,也就是把EXCEL里复制的表格粘贴到outlook正文的代码如何写,不会,在线等待高手指教,谢谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询