I am looking to add in a "High Priority" to an Email generated from Access. I know there are 2 methods of creating the email - I would like to adapt this piece of code ...
DoCmd.SendObject acSendNoObject, , , Me.email
Rather than the full create outlook object etc (code attached) as I really don't want to have to download a bolt on program such as YesClick Pro to bypass outlook's security
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application", localhost)
'Set objOutlook = Outlook.Application
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
' Add the To recipient(s) to the message. Substitute
' your names here.
Set objOutlookRecip = .Recipients.Add("email@example.com") '<--Recipient's name or email address
objOutlookRecip.Type = olTo
' Add the CC recipient(s) to the message.
'Set objOutlookRecip = .Recipients.Add("CC Recipient Name")
'objOutlookRecip.Type = olCC
' Set the Subject, Body, and Importance of the message.
.Subject = "Blah Blah Blah" '<--Subject
.Body = "Dear Tom" & vbCr & vbCr
'<--Email Body text.
.Importance = olImportanceHigh 'High importance
'Add attachments to the message.
'Set objOutlookAttach = .Attachments.Add("C:\Earth.jpg") '<-- Add as many attachments as you need here.
'Set objOutlookAttach = .Attachments.Add("C:\TextFile.txt")
' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
If Not objOutlookRecip.Resolve Then
'Send email without viewing it.
'Dispay email before sending.
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Set objOutlookRecip = Nothing
Set objOutlookAttach = Nothing