Hello,
I'm running:
access 2016
outlook 2016
having a few issues...
1) need to be able to state certain font and size for email
2) need to be able to make certain words in the body bold
3) email need to be Send From a different email address, not mine
the code below works,
however, no matter what I try, I cant seem to tackle the three items above...
any help would be greatly appreciated...
thanks
The Code:
I'm running:
access 2016
outlook 2016
having a few issues...
1) need to be able to state certain font and size for email
2) need to be able to make certain words in the body bold
3) email need to be Send From a different email address, not mine
the code below works,
however, no matter what I try, I cant seem to tackle the three items above...
any help would be greatly appreciated...
thanks
The Code:
Code:
Private Sub Send_eMail_McKay_Guar_1_Click()
Dim MyDb As DAO.Database
Dim rs As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim prm As DAO.Parameter
Dim strEmail As String
Dim strMsg As String
Dim oLook As Object
Dim oMail As Object
Set MyDb = CurrentDb
Set qdf = MyDb.QueryDefs("qrySHLMG1")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next
Set rs = CurrentDb.OpenRecordset("SELECT GlobalID, RptName, Deadline, pl_LegalPlanName, Salutation2, AdminNameForward FROM qrySHLMG1")
Set oLook = CreateObject("Outlook.Application")
With rs
.MoveFirst
Do Until rs.EOF
myRecipient = .Fields(0)
If IsNull(myRecipient) = False Then
Set oLook = CreateObject("Outlook.Application")
Set oMail = oLook.CreateItem(0)
With oMail
.To = "
.cc = ""
.bcc = ""
.body = "Hello " & rs!Salutation2 & vbCrLf & vbCrLf & "Attached is the required annual notice for the " & rs!pl_LegalPlanName & ". " & "Please open the attachment and follow the instructions on the cover letter. " & "The safe harbor notice should be distributed to participants no later than " & rs!Deadline & ". " & vbCrLf & vbCrLf & "If you have any questions, please do not hesitate to contact" & rs!AdminNameForward & " or me anytime. " & vbCrLf & vbCrLf & "Best regards, "
.Importance = 2 'Importance Level 0=Low,1=Normal,2=High
.Subject = "Required Annual Notice for the " & rs!pl_LegalPlanName
.Attachments.Add ("C:\Users\me\Documents\RPTTESTEXPORT\test.pdf")
.Send
End With
End If
.MoveNext
Loop
End With
Set oMail = Nothing
Set oLook = Nothing
End Sub