0
目前我有這個代碼發送電子郵件根據另一種形式的標準。我正在爲此創建的部門指定了多個人可能會收到該電子郵件。我如何獲得Access查看我已經構建的查詢。查看用戶表時會檢查哪些人可以收到這些電子郵件並通過電子郵件從查詢中發送電子郵件列表?訪問2007多個收件人電子郵件
Select Case Forms!FRM_CallDetails!Model.Value
Case "SM", "TW", "LM", "LV", "SV"
On Error Resume Next
DoCmd.OutputTo acOutputForm, "FRM_CallDetails", acFormatXLS, "C:\temp\WatchList.xls", False
'Get Outlook if it's running
Set oApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
'Outlook wasn 't running, start it from code
Set oApp = CreateObject("Outlook.Application")
Started = True
End If
Set oItem = oApp.CreateItem(olMailItem)
With oItem
.To = "[email protected]"
.Subject = "AutoEmail"
.Body = " this is the body of the email... this is a test email "
.Attachments.Add "C:\temp\WatchList.xls"
'Send the email
.Send
End With
Set oItem = Nothing
If Started Then
oApp.Quit
End If
'Display message to the user
MsgBox "A model that is on the watch list has been selected. An Automatic Email has been sent.", vbOKOnly
'Message Body Here
Case Else
'no email
End Select
下面是我使用的查詢,我已呼籲Mail_List
SELECT TBL_Users.Email_Address
FROM TBL_Users
WHERE (((TBL_Users.EW_Email)="Y"));
完美的是,這正是我所需要的,它實時生成查詢的事實對於即時更新更好。完美! – ASM2701