troubleshooting Question

Access Email

Avatar of shieldsco
shieldscoFlag for United States of America asked on
OutlookMicrosoft Access
2 Comments1 Solution179 ViewsLast Modified:
I'm using the following coded to generated Outlook emails from Access. The output is in the format :
Emily.Rosenb@abc.gov#mailto:Emily.Rosenb@abc
How would I remove the #mailto:Emily.Rosenb@abc?





On Error GoTo err
    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Dim strBody As String
    Dim db As Database
    Dim rs As Recordset
    Dim emailcount As Long
    
    emailcount = 0
    
    Set OutApp = CreateObject("Outlook.Application")
    Set db = CurrentDb

    Select Case Me.EMAILTYPE
        Case "Annual Training"
            Set rs = Forms!frmAnnualTraining.Form.RecordsetClone
    End Select

    If rs.RecordCount = 0 Then
        MsgBox "There are no reminders to create!", vbCritical, "Reminders"
        Set rs = Nothing
        Exit Sub
    End If
            
    rs.MoveFirst
    Do Until rs.EOF
        If Not IsNull(rs![EMPEMAIL]) And IsNull(rs![AETDATE]) Then
            Set OutMail = OutApp.CreateItem(0)
            With OutMail
                .To = rs![EMPEMAIL]
                .CC = ""
                .BCC = ""
                .Subject = Me.EMAILSUBJECT
                .HTMLBody = Me.EMAILDESC
                .Save
                emailcount = emailcount + 1
            End With
        End If
        rs.MoveNext
    Loop

If emailcount = 0 Then MsgBox "There are no employees without an Annual Training date for the calendar year." Else MsgBox "Created Alerts.  Please review them and send."
DoCmd.Close acForm, "frmReminders"
Exit Sub

err:
MsgBox "Unable to create emails at this time.  If problem persists, contact system administrator."
MsgBox err.Description
Exit Sub
End Sub
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros