Search code examples
excelvbaoutlookhtml-email

I have worked & reworked the strbody block, still I receive compiling errors. I've also mirrored the code to other programs and still receive errors


    trbody = "Good Morning " & Cells(i, 15).Value + "," _
                    & vbNewLine & vbNewLine _
                    & "Can you please verify if the following check(s) are still outstanding?" + _
                    vbNewLine & vbNewLine _
                    & "Check # " + Cells(i, 1).Value + "-- " + "Check Date: " & Cells(i, 6).Value & "-- " + "Net Amount: $" + Cells(i, 6).Value + "-- " + Cells(i, 2).Value + _
                     vbNewLine & vbNewLine & vbNewLine & vbNewLine + _
                     "Regards," + _
                    vbNewLine & vbNewLine & vbNewLine & vbNewLine _

Example intended output:

    Good Afternoon Emily,
    
    Can you please verify if the following check is still outstanding?
    
    Check # 1000000– Check Date: 12/15/22– Net Amount: $2,431.52– Schwartz, Melvin
    
    
    Regards,

Solution

  • The following code works like a charm on my side:

    rbody = "Good Morning " & Cells(i, 15).Value & "," _
                        & vbNewLine & vbNewLine _
                        & "Can you please verify if the following check(s) are still outstanding?" & _
                        vbNewLine & vbNewLine _
                        & "Check # " & Cells(i, 1).Value & "-- " & "Check Date: " & Cells(i, 6).Value & "-- " & "Net Amount: $" & Cells(i, 6).Value & "-- " & Cells(i, 2).Value & _
                         vbNewLine & vbNewLine & vbNewLine & vbNewLine & _
                         "Regards,"