Hi
I have cobbled some code from the MSDN site to send a series of personalised emails each with individual attachments.
The issue I have is that I have to repeatedly click on security messages and also to jump back and forward between my Outlook pane and my Access pane. I can fathom this but I think I am on a hiding to nothing to expect my client to do this.
I also have one unexpected message box which simply says Microsoft Access and Yes. I cannot see which line is generating it and would like to get it out simply to make the process simpler.
The variables (strSubject etc) are all populated elsewhere in the sub.
The code I have is
If anyone can ease this one for me or suggest an alternative - I know the client will be using Access 2003 and Outlook 2003 - I may be able to persuade him to use another tool even if only to run his emails out of this database.
Hope someone can help
Best wishes
I have cobbled some code from the MSDN site to send a series of personalised emails each with individual attachments.
The issue I have is that I have to repeatedly click on security messages and also to jump back and forward between my Outlook pane and my Access pane. I can fathom this but I think I am on a hiding to nothing to expect my client to do this.
I also have one unexpected message box which simply says Microsoft Access and Yes. I cannot see which line is generating it and would like to get it out simply to make the process simpler.
The variables (strSubject etc) are all populated elsewhere in the sub.
The code I have is
Code:
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add(strEmailAddress)
objOutlookRecip.Type = olTo
' Set the Subject, Body, and Importance of the message.
.Subject = strSubject
.Body = strMessage & vbCrLf & vbCrLf
.Importance = olImportanceHigh 'High importance
' Add attachments to the message.
Set objOutlookAttach = .Attachments.Add(strAttachmentFullPath)
.Send
End With
If anyone can ease this one for me or suggest an alternative - I know the client will be using Access 2003 and Outlook 2003 - I may be able to persuade him to use another tool even if only to run his emails out of this database.
Hope someone can help
Best wishes