I have some code that outputs to a text email currently whereby it sets the Venue address in the correct format, for example if there is only one address line, it concatenates the string to exclude the missing line and formats the address correctly
This is part of the code that does that
I have now changed my code slightly as I wish to create a HTML email, the email output works fine, however, if one of the address lines isn't populated, it leaves the blank line in the address on the email.
This is the code I am currently using
Is there a way of replicating the same as the vbCrLf and format the address with no blank lines?
This is part of the code that does that
"" & .Fields(5) + vbCrLf & _
"" & .Fields(6) + vbCrLf & _
"" & .Fields(7) + vbCrLf & _
"" & .Fields(8) + vbCrLf & _
"" & .Fields(9) + vbCrLf & _
"" & .Fields(10)
I have now changed my code slightly as I wish to create a HTML email, the email output works fine, however, if one of the address lines isn't populated, it leaves the blank line in the address on the email.
This is the code I am currently using
sMessageBody = "Dear Delegate<br> " & _
"<br>" & _
"<br>" & _
"This email is confirmation of your place on the following course:<br>" & _
"<br>" & _
"<br>" & _
"" & sSubject & _
"<br>" & _
"" & sCourseDate & _
"<br>" & _
"The course Trainer is: " & sCourseTrainer & _
"<br>" & _
"<br>" & _
"The Course Venue is:" & _
"<br>" & _
"<br>" & _
"" & sVenueName + "<br>" & _
"" & sVenueAddressL1 + "<br>" & _
"" & sVeneuAddressL2 + "<br>" & _
"" & sVenueTown + "<br>" & _
"" & sVenueCounty + "<br>" & _
"" & sVenuePostcode
Is there a way of replicating the same as the vbCrLf and format the address with no blank lines?
Last edited: