Email Access 2007对Word、Outlook进行两步邮件合并
我的VBA做电子邮件合并奇妙。。。除此之外,对于生成的每封电子邮件,我必须从Outlook中单击“允许”两次。有没有办法通过编程来解决这个问题 我正在运行Windows7企业版SP1。微软办公软件2007。电脑锁得很紧。不支持HTML格式的电子邮件-仅支持纯文本。我没有本地管理员权限。我无法安装额外的加载项或第三方软件,因为我已经多次发现这一点 以下是我的工作VBA: 专用子发送\电子邮件\合并() 端接头Email Access 2007对Word、Outlook进行两步邮件合并,email,ms-word,ms-access-2007,outlook-2007,mailmerge,Email,Ms Word,Ms Access 2007,Outlook 2007,Mailmerge,我的VBA做电子邮件合并奇妙。。。除此之外,对于生成的每封电子邮件,我必须从Outlook中单击“允许”两次。有没有办法通过编程来解决这个问题 我正在运行Windows7企业版SP1。微软办公软件2007。电脑锁得很紧。不支持HTML格式的电子邮件-仅支持纯文本。我没有本地管理员权限。我无法安装额外的加载项或第三方软件,因为我已经多次发现这一点 以下是我的工作VBA: 专用子发送\电子邮件\合并() 端接头 非常感谢您的帮助。您可以直接从Access自动执行操作。有关更多信息,请参阅。它描述了从
非常感谢您的帮助。您可以直接从Access自动执行操作。有关更多信息,请参阅。它描述了从其他应用程序自动化Outlook所需的所有步骤。Eugene,感谢您的回复。不幸的是,您的链接将我带到Outlook 2000的参考,Outlook 2007的参考稍微过时。到目前为止没有任何更改。
Dim sDBPath As String
'Word variables
Dim oWD As Word.Application
Dim oDoc As Word.Document
Dim RecCount As Long
'Sanity check on how many e-mails to be sent
RecCount = DLookup("[Email Count]", "qry_EmailMerge_Count")
Debug.Print RecCount
Set oWD = CreateObject("Word.Application")
oWD.Visible = True
Set oDoc = oWD.Documents.Open("C:\MyTemp\MyDocs\MyEmailMerge.docx")
With oDoc.MailMerge
.MainDocumentType = wdFormLetters
sDBPath = "C:\MyTemp\MydBs\My_Engine.accdb"
.OpenDataSource Name:=sDBPath, _
SQLStatement:="SELECT * FROM [qry_E Mail Merge]"
End With
oWD.Activate
oWD.Documents.Parent.Visible = True
oWD.Application.WindowState = 1
oWD.ActiveWindow.WindowState = 1
With oDoc.MailMerge
.Destination = wdSendToEmail
.MailAddressFieldName = "Email Address"
.MailSubject = "Your Action Required"
.MailFormat = wdMailFormatPlainText
.Execute
End With
oWD.Activate
oWD.Documents.Parent.Visible = True
oWD.Application.WindowState = 1
oWD.ActiveWindow.WindowState = 1
oWD.ActiveDocument.Close
oWD.Quit
Set oWD = Nothing
Set oDoc = Nothing