【发布时间】:2018-12-19 07:40:17
【问题描述】:
我正在使用下面的代码从 Excel 创建电子邮件:
Sub TEST()
Dim outlook As Object
Dim newEmail As Object
Set outlook = CreateObject("Outlook.Application")
Set newEmail = outlook.CreateItem(0)
With newEmail
.To = Sheet1.Range("L2").Text
.Subject = Sheet1.Range("E1").Text
' .Body = "" & vbNewLine & signature
.Display
Dim xInspect As Object
Dim pageEditor As Object
Set xInspect = newEmail.GetInspector
Set pageEditor = xInspect.WordEditor
Sheet1.Range("B4:L37").Copy
pageEditor.Application.Selection.Start = Len(.Body)
pageEditor.Application.Selection.End = pageEditor.Application.Selection.Start
pageEditor.Application.Selection.Paste
Set pageEditor = Nothing
Set xInspect = Nothing
End With
Set newEmail = Nothing
Set outlook = Nothing
End Sub
我的签名会自动出现在正文之前。
之后有没有办法插入我的签名?
【问题讨论】:
-
你能展示你的excel表格的样本吗?
标签: excel vba outlook outlook-2010