Sql 在ms access 2010中发送带有两个附件的电子邮件的按钮
我有一个数据库,我想在其中创建一个按钮,将发送带有两个附件的电子邮件 来自outlook。可以指定文件的路径。它应该会弹出一个类似于你创建新邮件时得到的表单的弹出窗口,以检查邮件中的正文是否正确 你知道如何做到这一点吗Sql 在ms access 2010中发送带有两个附件的电子邮件的按钮,sql,email,vba,ms-access,Sql,Email,Vba,Ms Access,我有一个数据库,我想在其中创建一个按钮,将发送带有两个附件的电子邮件 来自outlook。可以指定文件的路径。它应该会弹出一个类似于你创建新邮件时得到的表单的弹出窗口,以检查邮件中的正文是否正确 你知道如何做到这一点吗 Private Sub Command0_Click() 'Arvin Meyer 03/12/1999 'Updated 7/21/2001 On Error GoTo Error_Handler Dim objOutlook As Outlook.Application D
Private Sub Command0_Click()
'Arvin Meyer 03/12/1999
'Updated 7/21/2001
On Error GoTo Error_Handler
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = "info@datastrat.com"
.Subject = "Look at this sample attachment"
.body = "The body doesn't matter, just the attachment"
.Attachments.Add "C:\Test.htm"
'.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
'.ReadReceiptRequested
End With
Exit_Here:
Set objOutlook = Nothing
Exit Sub
Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here
End Sub
想出来了!!!!多亏了ryadavilli 而不是。发送它是。显示
它是有效的您可以通过编写一些VBA代码来实现这一点。如何显示您的尝试?我使用了一些代码,但它直接发送电子邮件,没有弹出窗口检查此小提琴我不确定您正在使用的对象的详细信息,但如果您希望用户查看邮件,您可能不应该呼叫
。Send
。您可能会显示(或任何类似内容),然后让用户发送邮件。