I have a table with a field that holds a contacts email address. I would like to send a message to all the contacts in that table. Is there a way I can use the address stored in the table to automatically send this message? Thanks in advance.
Public objOutl As New Outlook.Application ' <- needs a reference !
Function CreateEmail(strRecipient As String)
Dim dummy As Long
Dim itmOutl As MailItem
Dim tmpOutl As Outlook.Application
On Error Resume Next
Set tmpOutl = GetObject(, "Outlook.Application"
If Err.Number <> 0 Then
Set objOutl = New Outlook.Application
Err.Clear
Else
Set objOutl = tmpOutl
End If
On Error GoTo 0
Set itmOutl = objOutl.CreateItem(olMailItem)
itmOutl.Display False
itmOutl.Recipients.Add strRecipient
'itmOutl.Send
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.