[AccessD] Bold In an Email

Rocky Smolin rockysmolin2 at gmail.com
Fri Mar 4 10:52:24 CST 2022


I am still not clear on how to modify the code:

Here's the code.  Where would you make the mods?

MMTIA

Rocky

    Set myolApp = CreateObject("Outlook.Application")

    Set myItem = myolApp.CreateItem(0)
    myItem.Display

    myItem.To = Nz(DLookup("fldDLEmail", "tblDiscussionLeader",
"fldDiscussionLeaderID = " & Val(Me.fldDiscussionLeaderID)), "")
    myItem.CC = Nz(DLookup("fldUserEmail", "tblUser", "fldUserID = " &
Val(Me.fldAdministratorID)), "")
    myItem.Subject = "Course GO Confirmation " & Me.fldCourseNumber

    myItem.body = "Hi " & Nz(DLookup("fldDLFirstName",
"tblDiscussionLeader", "fldDiscussionLeaderID = " &
Val(Me.fldDiscussionLeaderID)), "") & ":"
    myItem.body = myItem.body & vbCrLf

    strPrimaryContactName = ""
    If rs.BOF = False And rs.EOF = False Then strPrimaryContactName =
rs!fldClientPersonFirstName & " " & rs!fldClientPersonLastName

    ' count of participants
    If Me.fldCourseRoster = False Then ' yes roster
        myItem.body = myItem.body & "I am confirming that the above
referenced course is a GO. Right now we show " _
            & DCount("fldCourseParticipantSheetID",
"tblCourseParticipantSheet", "fldCourseID = " & Me.fldCourseID) _
            & " participant(s). Please be sure to coordinate with " &
strPrimaryContactName & " and the participant(s)."
    Else ' no roster
        myItem.body = myItem.body & "I am confirming that the above
referenced course is a GO. Right now we show " & Me.fldCourseNoRosterCount _
        & " participant(s). Please be sure to coordinate with " &
strPrimaryContactName & " and the participant(s)."
    End If

    myItem.body = myItem.body & vbCrLf

    myItem.body = myItem.body & "Preferred Start Date:   " &
Nz(Me.fldCourseStartDate, "")
    myItem.body = myItem.body & "Credit Hours:                " &
Nz(Me.fldCourseCreditHours, "")
    myItem.body = myItem.body & "Course Duration:          " &
Nz(Me.fldCourseDuration, "")

    If Me.fldCourseVirtualInPerson = 2 Then
        myItem.body = myItem.body & "Type:
 Virtual"
    Else
        myItem.body = myItem.body & "Type:                             In
Person"
    End If

    myItem.body = myItem.body & vbCrLf

    myItem.body = myItem.body & "*** This is a blended course, so please
send out the prework and testing instructions. We will be doing the
certificates on this."
    myItem.body = myItem.body & vbCrLf

    myItem.body = myItem.body & "*** CPE hour course and the certificates
will be done by:"
    myItem.body = myItem.body & vbCrLf

    If rs.BOF = False And rs.EOF = False Then
        myItem.body = myItem.body & "Name:                           " &
rs!fldClientPersonFirstName & " " & rs!fldClientPersonLastName
        myItem.body = myItem.body & "Email:                            " &
rs!fldClientPersonEmail
    Else
        myItem.body = myItem.body & "Name: "
        myItem.body = myItem.body & "Email: "
    End If

    myItem.body = myItem.body & vbCrLf
    myItem.body = myItem.body & "Thank You,"
    myItem.body = myItem.body & vbCrLf

    myItem.body = myItem.body & Me.fldAdministratorID.Column(3) & vbCrLf
    myItem.body = myItem.body & Me.fldAdministratorID.Column(4) & vbCrLf
    myItem.body = myItem.body & Me.fldAdministratorID.Column(5) & vbCrLf

    rs.Close
    Set rs = Nothing
    db.Close
    Set db = Nothing

    myItem.Display

    Set myolApp = Nothing
    Set myItem = Nothing


On Fri, Mar 4, 2022 at 3:56 AM Jim Dettman via AccessD <
accessd at databaseadvisors.com> wrote:

>
>  That's a good way to go at it to.
>
> Jim.
>
> -----Original Message-----
> From: AccessD On Behalf Of Stuart McLachlan
> Sent: Thursday, March 3, 2022 4:18 PM
> To: Access Developers discussion and problem solving
> <accessd at databaseadvisors.com>
> Subject: Re: [AccessD] Bold In an Email
>
> Since you are uilding your body elsewhere with a string which is being
> converted from text
> to  HTML  you probably need to do something like this to get it at the end
> of the HTML body:
>
> strHTML = myItem.body
> strAddition =  <BR> <b style='color:red;'> *** This is a blended
> course, so please send out the prework and testing instructions. We
> will be doing the certificates on this.</b> </BODY>"
>
> myItme.body = Replace (strHTML,"</BODY",strAddition)
>
>
>
>


More information about the AccessD mailing list