我有一个代码下面粘贴范围到电子邮件正文,但我的问题是文本正文**这是正文:**是下面的粘贴范围时,代码运行,也许有人可以帮助如何把它上面的粘贴范围
Sub SendEmailWithRange()
Dim MyRange As Range
Dim doc As Object
Set MyRange = Sheets("Sheet1").Range("A4").CurrentRegion
With CreateObject("outlook.application").CreateItem(0)
.Display 'Change to .Send to send the email immediately
.Body = "This is the body:" '& vbNewLine & vbNewLine
Set doc = .GetInspector.WordEditor
MyRange.Copy
doc.Range(x, x).Paste
.To = Range("I3").Value
.Subject = "My subject"
Application.CutCopyMode = 0
End With
End Sub
1条答案
按热度按时间dxpyg8gm1#
粘贴前可能需要设置x。
x = doc.Range.End - 1
将查找文档末尾减1的位置在正文底部添加更多行