excel - 将 Excel 数据表条目拉入 Outlook 电子邮件模板的收件人
问题描述
目标是将 Excel 数据表/数据透视表连接到 Outlook 电子邮件模板。
有没有办法将原始条目创建者从数据透视表或表字段中拉到收件人部分以发送电子邮件?我正在尝试自动从此数据表中向多个用户发送电子邮件。有关向谁发送电子邮件的信息在表中。
这是我到目前为止所拥有的:
Sub SendMail()
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
Dim blRunning As Boolean
blRunning = True
on Error Resume Next
Set olApp = GetObject (,"Outlook.Application")
If olApp Is Nothing Then
Set olApp = New Outlook.Application
blRunning = False
End If
On Error GoTo 0
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.Subject = "Automatic Entry Support"
.Recipients.Add "J.Doe@gmail.com"
.Attachments.Add "C:\Users\J.Doe\Documents\Project\Template draft.xlsx"
.Body = "Support message"
.Display ("Spell check, data attached?, SEND")
End With
If Not blRunning Then olApp.Quit
Set olApp = Nothing
Set olMail = Nothing
End Sub
解决方案
找到表格的最后一行并 for 遍历收件人。看一下这个:
推荐阅读
- nginx - 用 $arg_lang 将旧的 php url 重写为 lang 文件夹中的新文件
- symfony - Symfony 4 - 在持久化之前比较两个对象?
- database - 在所有环境中部署 IIB bar 文件而不更改数据源名称 (DNS)
- python-3.x - ".geometry("LxH")" 和 ".minsize(L,H)" 在编译时没有给出正确的窗口大小
- javascript - 使用 javascript 插件包含页脚
- java - 我如何告诉 NEXUS 使用自定义信任库
- javascript - 链接管道操作后如何以角度从服务中返回可观察对象
- android - 在 Windows 10 上找不到 Android 的文件“debug.keystore”
- java - Android中compareTo函数中的查询
- python - 我的代码有什么问题?我是 Flask 的新手