M
m3tallica
Hi,
So this is what I have so far:
Private Sub Command38_click()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add
.Subject = "Instruction Required"
.Body = ""
.Importance = olImportanceHigh
Next
.Send
End Sub
Problem is, it doesn't achieve what I want it to achieve. The scenario:
A number of fields including a field containing email addresses - 'email' -
is present in the query 'Contacts'. There are roughly 7 records in this
query. I want to use this email code to send the same email to each record
in the query based on the 'email' field.
Now, the kicker is in the body of the text I need to reference other fields
present in the Contacts query - think of it as a mail merge, but not going
external and using the MS Word mail merge function in Access - so that each
email, whilst carrying the same message, is uniquely designed for each
individual record per the data in each field for that record.
Is this possible? I've tried a couple of angles but had little success.
I also realise i'm stuck here - Set objOutlookRecip = .Recipients.Add - in
getting it to add the emails present in the Contacts query. How to point it
to the right place?
I'm considering a recordset format but I need a working model as I can't
seem to work my recordset in.
Any ideas would be greatly appreciated. Thanks.
So this is what I have so far:
Private Sub Command38_click()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add
.Subject = "Instruction Required"
.Body = ""
.Importance = olImportanceHigh
Next
.Send
End Sub
Problem is, it doesn't achieve what I want it to achieve. The scenario:
A number of fields including a field containing email addresses - 'email' -
is present in the query 'Contacts'. There are roughly 7 records in this
query. I want to use this email code to send the same email to each record
in the query based on the 'email' field.
Now, the kicker is in the body of the text I need to reference other fields
present in the Contacts query - think of it as a mail merge, but not going
external and using the MS Word mail merge function in Access - so that each
email, whilst carrying the same message, is uniquely designed for each
individual record per the data in each field for that record.
Is this possible? I've tried a couple of angles but had little success.
I also realise i'm stuck here - Set objOutlookRecip = .Recipients.Add - in
getting it to add the emails present in the Contacts query. How to point it
to the right place?
I'm considering a recordset format but I need a working model as I can't
seem to work my recordset in.
Any ideas would be greatly appreciated. Thanks.